diff options
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_rdoc.rb')
-rw-r--r-- | test/rdoc/test_rdoc_markup_to_rdoc.rb | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_rdoc.rb b/test/rdoc/test_rdoc_markup_to_rdoc.rb index 06cae078c6..4b60d0133e 100644 --- a/test/rdoc/test_rdoc_markup_to_rdoc.rb +++ b/test/rdoc/test_rdoc_markup_to_rdoc.rb @@ -1,7 +1,4 @@ -require 'rubygems' -require 'rdoc/markup/text_formatter_test_case' -require 'rdoc/markup/to_rdoc' -require 'minitest/autorun' +require 'rdoc/test_case' class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase @@ -18,6 +15,10 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase assert_equal "\n", @to.res.join end + def accept_block_quote + assert_equal "> quote\n", @to.res.join + end + def accept_document assert_equal "hello\n", @to.res.join end @@ -67,7 +68,7 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase end def accept_list_item_end_label - assert_equal "\n", @to.res.join + assert_equal "cat:\n", @to.res.join assert_equal 0, @to.indent, 'indent' end @@ -77,7 +78,7 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase end def accept_list_item_end_note - assert_equal "\n", @to.res.join + assert_equal "cat:\n", @to.res.join assert_equal 0, @to.indent, 'indent' end @@ -244,10 +245,27 @@ class TestRDocMarkupToRDoc < RDoc::Markup::TextFormatterTestCase assert_equal "<tt>teletype</tt>:\n teletype description\n\n", @to.res.join end + def accept_list_item_start_note_multi_description + assert_equal "label:\n description one\n\n description two\n\n", + @to.res.join + end + + def accept_list_item_start_note_multi_label + assert_equal "one\ntwo:\n two headers\n\n", @to.res.join + end + def accept_paragraph_b assert_equal "reg <b>bold words</b> reg\n", @to.end_accepting end + def accept_paragraph_br + assert_equal "one\ntwo\n", @to.end_accepting + end + + def accept_paragraph_break + assert_equal "hello\nworld\n", @to.end_accepting + end + def accept_paragraph_i assert_equal "reg <em>italic words</em> reg\n", @to.end_accepting end @@ -327,6 +345,24 @@ words words words words assert_equal expected, @to.end_accepting end + # functional test + def test_convert_list_note + note_list = <<-NOTE_LIST +foo :: +bar :: + hi + NOTE_LIST + + expected = <<-EXPECTED +foo +bar: + hi + + EXPECTED + + assert_equal expected, @to.convert(note_list) + end + def test_accept_indented_paragraph ip = RDoc::Markup::IndentedParagraph.new 2, 'cats are cool' |