diff options
Diffstat (limited to 'test/rdoc/test_rdoc_markup_to_html_crossref.rb')
-rw-r--r-- | test/rdoc/test_rdoc_markup_to_html_crossref.rb | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb index f6fabfb7db..dc4488195a 100644 --- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb +++ b/test/rdoc/test_rdoc_markup_to_html_crossref.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -require File.expand_path '../xref_test_case', __FILE__ +require_relative 'xref_test_case' class TestRDocMarkupToHtmlCrossref < XrefTestCase @@ -17,6 +17,12 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase assert_equal para("<a href=\"C1.html\"><code>C1</code></a>"), result end + def test_convert_CROSSREF_method + result = @to.convert 'C1#m(foo, bar, baz)' + + assert_equal para("<a href=\"C1.html#method-i-m\"><code>C1#m(foo, bar, baz)</code></a>"), result + end + def test_convert_CROSSREF_label result = @to.convert 'C1@foo' assert_equal para("<a href=\"C1.html#class-C1-label-foo\">foo at <code>C1</code></a>"), result @@ -127,6 +133,18 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase 'rdoc-ref:C1@foo' end + def test_convert_RDOCLINK_rdoc_ref_label_in_current_file + result = @to.convert 'rdoc-ref:@foo' + + assert_equal para("<a href=\"#label-foo\">foo</a>"), result, + 'rdoc-ref:@foo' + + result = @to.convert '{Foo}[rdoc-ref:@foo]' + + assert_equal para("<a href=\"#label-foo\">Foo</a>"), result, + '{Foo}[rdoc-ref:@foo]' + end + def test_gen_url assert_equal '<a href="C1.html">Some class</a>', @to.gen_url('rdoc-ref:C1', 'Some class') @@ -260,4 +278,3 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase end end - |