summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_text.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-02-07 07:07:12 +0000
commit60f2c9cf5bea6dd99fac50c460eab4809cc30b01 (patch)
treeab40b4f7be3ff6d9fc8aede6b90e1aa9dded0aff /test/rdoc/test_rdoc_text.rb
parentca9f7009db8aea70af3dd58cb6c7de0010844d22 (diff)
Upgrade to RDoc 3.5.3. Fixes [Bug #4376]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_text.rb')
-rw-r--r--test/rdoc/test_rdoc_text.rb69
1 files changed, 67 insertions, 2 deletions
diff --git a/test/rdoc/test_rdoc_text.rb b/test/rdoc/test_rdoc_text.rb
index ebc92dc1a5..96635aaa8e 100644
--- a/test/rdoc/test_rdoc_text.rb
+++ b/test/rdoc/test_rdoc_text.rb
@@ -55,6 +55,18 @@ class TestRDocText < MiniTest::Unit::TestCase
expand_tabs(".\t\t."), 'dot tab tab dot')
end
+ def test_expand_tabs_encoding
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
+
+ inn = "hello\ns\tdave"
+ inn.force_encoding Encoding::BINARY
+
+ out = expand_tabs inn
+
+ assert_equal "hello\ns dave", out
+ assert_equal Encoding::BINARY, out.encoding
+ end
+
def test_flush_left
text = <<-TEXT
@@ -73,6 +85,31 @@ The comments associated with
assert_equal expected, flush_left(text)
end
+ def test_flush_left_encoding
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
+
+ text = <<-TEXT
+
+ we don't worry too much.
+
+ The comments associated with
+ TEXT
+
+ text.force_encoding Encoding::US_ASCII
+
+ expected = <<-EXPECTED
+
+we don't worry too much.
+
+The comments associated with
+ EXPECTED
+
+ result = flush_left text
+
+ assert_equal expected, result
+ assert_equal Encoding::US_ASCII, result.encoding
+ end
+
def test_markup
def formatter() RDoc::Markup::ToHtml.new end
@@ -223,8 +260,36 @@ The comments associated with
The comments associated with
EXPECTED
- assert_equal expected, strip_stars(text)
- assert_equal Encoding::CP852, text.encoding
+ result = strip_stars text
+
+ assert_equal expected, result
+ assert_equal Encoding::CP852, result.encoding
+ end
+
+ def test_strip_stars_encoding2
+ skip "Encoding not implemented" unless Object.const_defined? :Encoding
+
+ text = <<-TEXT
+/*
+ * * we don't worry too much.
+ *
+ * The comments associated with
+ */
+ TEXT
+
+ text.force_encoding Encoding::BINARY
+
+ expected = <<-EXPECTED
+
+ * we don't worry too much.
+
+ The comments associated with
+ EXPECTED
+
+ result = strip_stars text
+
+ assert_equal expected, result
+ assert_equal Encoding::BINARY, result.encoding
end
def test_to_html_apostrophe