From df7dac9174a31e71b58be6184e23bfe6b742a494 Mon Sep 17 00:00:00 2001 From: drbrain Date: Wed, 18 Sep 2013 23:33:36 +0000 Subject: * lib/rdoc: Update to RDoc 4.1.0.preview.1 RDoc 4.1.0 contains a number of enhancements including a new default style and accessibility support. You can see the changelog here: https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc * test/rdoc: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/rdoc/test_rdoc_markup_to_html.rb | 86 +++++++++++++++++++++++++++++++---- 1 file changed, 77 insertions(+), 9 deletions(-) (limited to 'test/rdoc/test_rdoc_markup_to_html.rb') diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb index ebd2fe7dd2..b1addc5dcb 100644 --- a/test/rdoc/test_rdoc_markup_to_html.rb +++ b/test/rdoc/test_rdoc_markup_to_html.rb @@ -256,7 +256,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase end def accept_paragraph_break - assert_equal "\n

hello
\nworld

\n", @to.res.join + assert_equal "\n

hello
world

\n", @to.res.join end def accept_paragraph_i @@ -288,7 +288,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase end def accept_rule - assert_equal "
\n", @to.res.join + assert_equal "
\n", @to.res.join end def accept_verbatim @@ -357,12 +357,12 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase @to.code_object = RDoc::NormalClass.new 'Foo' @to.start_accepting - @to.accept_heading @RM::Heading.new(1, 'Hello') + @to.accept_heading head(1, 'Hello') - links = ' ' + + links = ' ' + '' - assert_equal "\n

Hello#{links}

\n", + assert_equal "\n

Hello#{links}

\n", @to.res.join end @@ -389,6 +389,35 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase assert_equal "\n

Hello

\n", @to.res.join end + def test_accept_paragraph_newline + @to.start_accepting + + @to.accept_paragraph para("hello\n", "world\n") + + assert_equal "\n

hello world

\n", @to.res.join + end + + def test_accept_heading_output_decoration + @options.output_decoration = false + + @to.start_accepting + + @to.accept_heading @RM::Heading.new(1, 'Hello') + + assert_equal "\n

Hello

\n", @to.res.join + end + + def test_accept_heading_output_decoration_with_pipe + @options.pipe = true + @options.output_decoration = false + + @to.start_accepting + + @to.accept_heading @RM::Heading.new(1, 'Hello') + + assert_equal "\n

Hello

\n", @to.res.join + end + def test_accept_verbatim_parseable verb = @RM::Verbatim.new("class C\n", "end\n") @@ -422,6 +451,24 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase assert_equal expected, @to.res.join end + def test_accept_verbatim_pipe + @options.pipe = true + + verb = @RM::Verbatim.new("1 + 1\n") + verb.format = :ruby + + @to.start_accepting + @to.accept_verbatim verb + + expected = <<-EXPECTED + +
1 + 1
+
+ EXPECTED + + assert_equal expected, @to.res.join + end + def test_accept_verbatim_ruby verb = @RM::Verbatim.new("1 + 1\n") verb.format = :ruby @@ -457,13 +504,13 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase def test_convert_RDOCLINK_label_foottext result = @to.convert 'rdoc-label:foottext-1' - assert_equal "\n

*1

\n", result + assert_equal "\n

1

\n", result end def test_convert_RDOCLINK_label_footmark result = @to.convert 'rdoc-label:footmark-1' - assert_equal "\n

^1

\n", result + assert_equal "\n

1

\n", result end def test_convert_RDOCLINK_ref @@ -475,7 +522,28 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase def test_convert_TIDYLINK_footnote result = @to.convert 'text{*1}[rdoc-label:foottext-1:footmark-1]' - assert_equal "\n

text*1

\n", result + assert_equal "\n

text1

\n", result + end + + def test_convert_TIDYLINK_multiple + result = @to.convert '{a}[http://example] {b}[http://example]' + + expected = <<-EXPECTED + +

a b

+ EXPECTED + + assert_equal expected, result + end + + def test_convert_TIDYLINK_image + result = + @to.convert '{rdoc-image:path/to/image.jpg}[http://example.com]' + + expected = + "\n

\n" + + assert_equal expected, result end def test_convert_TIDYLINK_rdoc_label @@ -501,7 +569,7 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase end def test_gen_url_rdoc_label_id - assert_equal 'example', + assert_equal 'example', @to.gen_url('rdoc-label:foottext-1:footmark-1', 'example') end -- cgit v1.2.3