diff options
author | Peter Zhu <peter@peterzhu.ca> | 2022-03-08 17:02:35 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-03-09 23:38:45 +0900 |
commit | f62f91313259539e8f0884a0ca99deb3ab8b87d3 (patch) | |
tree | 0a84c4597cdaaa579ffe884fcc2cbe9eb84a2071 /test | |
parent | 77f3f8a1d4f45d06df6cfea2bac3a67867c19efb (diff) |
[ruby/rdoc] Support crossref of methods with multiple arguments
For example, consider the following markup:
C1#m(a, b)
Before this patch, it generated this HTML:
<p><a href=\"C1.html#method-i-m\"><code>C1#m</code></a>(a, b)</p>
Which places the method arguments outside of the link.
Now it generates this HTML:
<a href=\"C1.html#method-i-m\"><code>C1#m(a, b)</code></a>
https://github.com/ruby/rdoc/commit/05a2b2222b
Diffstat (limited to 'test')
-rw-r--r-- | test/rdoc/test_rdoc_markup_to_html_crossref.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/rdoc/test_rdoc_markup_to_html_crossref.rb b/test/rdoc/test_rdoc_markup_to_html_crossref.rb index 1c778a4fad..4b87dd5da5 100644 --- a/test/rdoc/test_rdoc_markup_to_html_crossref.rb +++ b/test/rdoc/test_rdoc_markup_to_html_crossref.rb @@ -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 |