Skip to content

Commit 4c7e445

Browse files
authored
Merge pull request #633 from aycabta/use-original-method-notation
Use original method notation
2 parents fd547c5 + 7bc46d4 commit 4c7e445

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/rdoc/markup/to_html_crossref.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ def link name, text
135135

136136
ref = @cross_reference.resolve name, text
137137

138-
text = ref.output_name @context if
139-
RDoc::MethodAttr === ref and text == original_name
140-
141138
case ref
142139
when String then
143140
ref

test/test_rdoc_markup_to_html_crossref.rb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def test_convert_RDOCLINK_rdoc_ref
5959
def test_convert_RDOCLINK_rdoc_ref_method
6060
result = @to.convert 'rdoc-ref:C1#m'
6161

62-
assert_equal para("<a href=\"C1.html#method-i-m\">#m</a>"), result
62+
assert_equal para("<a href=\"C1.html#method-i-m\">C1#m</a>"), result
6363
end
6464

6565
def test_convert_RDOCLINK_rdoc_ref_method_label
@@ -75,13 +75,13 @@ def test_convert_RDOCLINK_rdoc_ref_method_percent
7575

7676
result = @to.convert 'rdoc-ref:C1#%'
7777

78-
assert_equal para("<a href=\"C1.html#method-i-25\">#%</a>"), result
78+
assert_equal para("<a href=\"C1.html#method-i-25\">C1#%</a>"), result
7979

8080
m.singleton = true
8181

8282
result = @to.convert 'rdoc-ref:C1::%'
8383

84-
assert_equal para("<a href=\"C1.html#method-c-25\">::%</a>"), result
84+
assert_equal para("<a href=\"C1.html#method-c-25\">C1::%</a>"), result
8585
end
8686

8787
def test_convert_RDOCLINK_rdoc_ref_method_percent_label
@@ -200,11 +200,16 @@ def test_to_html_CROSSREF_email_hyperlink_all
200200
def test_link
201201
assert_equal 'n', @to.link('n', 'n')
202202

203-
assert_equal '<a href="C1.html#method-c-m">::m</a>', @to.link('m', 'm')
203+
assert_equal '<a href="C1.html#method-c-m">m</a>', @to.link('m', 'm')
204+
end
205+
206+
def test_link_for_method_traverse
207+
@to = RDoc::Markup::ToHtmlCrossref.new @options, 'C2.html', @c9
208+
assert_equal '<a href="C9/A.html#method-i-foo">C9::B#foo</a>', @to.link('C9::B#foo', 'C9::B#foo')
204209
end
205210

206211
def test_link_class_method_full
207-
assert_equal '<a href="Parent.html#method-c-m">Parent.m</a>',
212+
assert_equal '<a href="Parent.html#method-c-m">Parent::m</a>',
208213
@to.link('Parent::m', 'Parent::m')
209214
end
210215

0 commit comments

Comments
 (0)