From 60f2c9cf5bea6dd99fac50c460eab4809cc30b01 Mon Sep 17 00:00:00 2001 From: drbrain Date: Mon, 7 Feb 2011 07:07:12 +0000 Subject: 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 --- test/rdoc/test_rdoc_text.rb | 69 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) (limited to 'test/rdoc/test_rdoc_text.rb') 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 -- cgit v1.2.3