diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-27 04:28:14 +0000 |
commit | 1c279a7d2753949c725754e1302f791b76358114 (patch) | |
tree | 36aa3bdde250e564445eba5f2e25fcb96bcb6cef /test/rdoc/test_rdoc_markup_to_ansi.rb | |
parent | c72f0daa877808e4fa5018b3191ca09d4b97c03d (diff) | |
download | ruby-1c279a7d2753949c725754e1302f791b76358114.tar.gz |
* lib/rdoc*: Updated to RDoc 4.0 (pre-release)
* bin/rdoc: ditto
* test/rdoc: ditto
* NEWS: Updated with RDoc 4.0 information
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_ansi.rb')
-rw-r--r-- | test/rdoc/test_rdoc_markup_to_ansi.rb | 49 |
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 |