aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_markup_to_ansi.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_ansi.rb')
-rw-r--r--test/rdoc/test_rdoc_markup_to_ansi.rb49
1 files changed, 43 insertions, 6 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_ansi.rb b/test/rdoc/test_rdoc_markup_to_ansi.rb
index f60d1999c2..5afaf94350 100644
--- a/test/rdoc/test_rdoc_markup_to_ansi.rb
+++ b/test/rdoc/test_rdoc_markup_to_ansi.rb
@@ -1,7 +1,4 @@
-require 'rubygems'
-require 'rdoc/markup/text_formatter_test_case'
-require 'rdoc/markup/to_ansi'
-require 'minitest/autorun'
+require 'rdoc/test_case'
class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
@@ -18,6 +15,10 @@ class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
assert_equal "\e[0m\n", @to.res.join
end
+ def accept_block_quote
+ assert_equal "\e[0m> quote\n", @to.res.join
+ end
+
def accept_document
assert_equal "\e[0mhello\n", @to.res.join
end
@@ -67,7 +68,7 @@ class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
end
def accept_list_item_end_label
- assert_equal "\e[0m", @to.res.join
+ assert_equal "\e[0mcat:\n", @to.res.join
assert_equal 0, @to.indent, 'indent'
end
@@ -77,7 +78,7 @@ class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
end
def accept_list_item_end_note
- assert_equal "\e[0m", @to.res.join
+ assert_equal "\e[0mcat:\n", @to.res.join
assert_equal 0, @to.indent, 'indent'
end
@@ -245,10 +246,28 @@ class TestRDocMarkupToAnsi < RDoc::Markup::TextFormatterTestCase
@to.res.join
end
+ def accept_list_item_start_note_multi_description
+ assert_equal "\e[0mlabel:\n description one\n\n description two\n\n",
+ @to.res.join
+ end
+
+ def accept_list_item_start_note_multi_label
+ assert_equal "\e[0mone\ntwo:\n two headers\n\n",
+ @to.res.join
+ end
+
def accept_paragraph_b
assert_equal "\e[0mreg \e[1mbold words\e[m reg\n", @to.end_accepting
end
+ def accept_paragraph_br
+ assert_equal "\e[0mone\ntwo\n", @to.end_accepting
+ end
+
+ def accept_paragraph_break
+ assert_equal "\e[0mhello\nworld\n", @to.end_accepting
+ end
+
def accept_paragraph_i
assert_equal "\e[0mreg \e[4mitalic words\e[m reg\n", @to.end_accepting
end
@@ -328,5 +347,23 @@ 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
+\e[0mfoo
+bar:
+ hi
+
+ EXPECTED
+
+ assert_equal expected, @to.convert(note_list)
+ end
+
end