summaryrefslogtreecommitdiff
path: root/test/rdoc/test_rdoc_markup_to_html.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 00:46:16 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-18 00:46:16 +0000
commitfd25f74d64c69d636764ea11aa5a809b85e58f69 (patch)
tree40585659bf4b9665ad0d258c415a6765a056d35d /test/rdoc/test_rdoc_markup_to_html.rb
parent0af4a490b48bb6fef8d4f392d0c0b215db8e06f9 (diff)
Import RDoc r101.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_html.rb')
-rw-r--r--test/rdoc/test_rdoc_markup_to_html.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_html.rb b/test/rdoc/test_rdoc_markup_to_html.rb
new file mode 100644
index 0000000000..463228cc4a
--- /dev/null
+++ b/test/rdoc/test_rdoc_markup_to_html.rb
@@ -0,0 +1,30 @@
+require 'test/unit'
+require 'rdoc/markup'
+require 'rdoc/markup/to_html'
+
+class TestRdocMarkupToHtml < Test::Unit::TestCase
+
+ def setup
+ @am = RDoc::Markup::AttributeManager.new
+ @th = RDoc::Markup::ToHtml.new
+ end
+
+ def test_tt_formatting
+ assert_equal "<p>\n<tt>--</tt> &#8212; <tt>(c)</tt> &#169;\n</p>\n",
+ util_format("<tt>--</tt> -- <tt>(c)</tt> (c)")
+ assert_equal "<p>\n<b>&#8212;</b>\n</p>\n", util_format("<b>--</b>")
+ end
+
+ def util_fragment(text)
+ RDoc::Markup::Fragment.new 0, nil, nil, text
+ end
+
+ def util_format(text)
+ fragment = util_fragment text
+
+ @th.start_accepting
+ @th.accept_paragraph @am, fragment
+ @th.end_accepting
+ end
+
+end