aboutsummaryrefslogtreecommitdiffstats
path: root/test/rdoc/test_rdoc_markup_to_html_crossref.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-20 03:22:49 +0000
commit2ef9c50c6e405717d06362787c4549ca4f1c6485 (patch)
treeee99486567461dd5796f3d6edcc9e204187f2666 /test/rdoc/test_rdoc_markup_to_html_crossref.rb
parentd7effd506f5b91a636f2e6452ef1946b923007c7 (diff)
downloadruby-2ef9c50c6e405717d06362787c4549ca4f1c6485.tar.gz
Import RDoc 3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_html_crossref.rb')
-rw-r--r--test/rdoc/test_rdoc_markup_to_html_crossref.rb25
1 files changed, 16 insertions, 9 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
index 67dfc0cbc9..8c97941727 100644
--- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb
+++ b/test/rdoc/test_rdoc_markup_to_html_crossref.rb
@@ -14,12 +14,11 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
end
def assert_ref(path, ref)
- assert_equal "<p>\n<a href=\"#{path}\">#{ref}</a>\n</p>\n",
- @xref.convert(ref)
+ assert_equal "\n<p><a href=\"#{path}\">#{ref}</a></p>\n", @xref.convert(ref)
end
def refute_ref(body, ref)
- assert_equal "<p>\n#{body}\n</p>\n", @xref.convert(ref)
+ assert_equal "\n<p>#{body}</p>\n", @xref.convert(ref)
end
def test_handle_special_CROSSREF_C2
@@ -108,16 +107,16 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
assert_ref 'C1.html#method-c-m', '::m'
assert_ref 'C1.html#method-i-m', 'C1#m'
- assert_ref 'C1.html#method-i-m', 'C1.m'
+ assert_ref 'C1.html#method-c-m', 'C1.m'
assert_ref 'C1.html#method-c-m', 'C1::m'
assert_ref 'C1.html#method-i-m', 'C1#m'
assert_ref 'C1.html#method-i-m', 'C1#m()'
assert_ref 'C1.html#method-i-m', 'C1#m(*)'
- assert_ref 'C1.html#method-i-m', 'C1.m'
- assert_ref 'C1.html#method-i-m', 'C1.m()'
- assert_ref 'C1.html#method-i-m', 'C1.m(*)'
+ assert_ref 'C1.html#method-c-m', 'C1.m'
+ assert_ref 'C1.html#method-c-m', 'C1.m()'
+ assert_ref 'C1.html#method-c-m', 'C1.m(*)'
assert_ref 'C1.html#method-c-m', 'C1::m'
assert_ref 'C1.html#method-c-m', 'C1::m()'
@@ -127,7 +126,8 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
assert_ref 'C2/C3.html#method-i-m', 'C2::C3.m'
- assert_ref 'C2/C3/H1.html#method-i-m%3F', 'C2::C3::H1#m?'
+ # TODO stop escaping - HTML5 allows anything but space
+ assert_ref 'C2/C3/H1.html#method-i-m-3F', 'C2::C3::H1#m?'
assert_ref 'C2/C3.html#method-i-m', '::C2::C3#m'
assert_ref 'C2/C3.html#method-i-m', '::C2::C3#m()'
@@ -153,8 +153,15 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
refute_ref '::C3::H1#n', '\::C3::H1#n'
end
+ def test_handle_special_CROSSREF_show_hash_false
+ @xref.show_hash = false
+
+ assert_equal "\n<p><a href=\"C1.html#method-i-m\">m</a></p>\n",
+ @xref.convert('#m')
+ end
+
def test_handle_special_CROSSREF_special
- assert_equal "<p>\n<a href=\"C2/C3.html\">C2::C3</a>;method(*)\n</p>\n",
+ assert_equal "\n<p><a href=\"C2/C3.html\">C2::C3</a>;method(*)</p>\n",
@xref.convert('C2::C3;method(*)')
end