Skip to content

Commit

Permalink
Allow full constant name to be compared.
Browse files Browse the repository at this point in the history
Partially resolves #399 at least inside the same context.
  • Loading branch information
Zachary Scott committed Mar 25, 2016
1 parent 7ad435e commit 86c8448
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/rdoc/context.rb
Expand Up @@ -789,7 +789,9 @@ def find_class_method_named(name)
# Finds a constant with +name+ in this context

def find_constant_named(name)
@constants.find {|m| m.name == name}
@constants.find do |m|
m.name == name || m.full_name == name
end
end

##
Expand Down
6 changes: 6 additions & 0 deletions test/test_rdoc_markup_to_html_crossref.rb
Expand Up @@ -44,6 +44,12 @@ def test_convert_CROSSREF_section
assert_equal para("<a href=\"C1.html#Section\">Section at C1</a>"), result
end

def test_convert_CROSSREF_constant
result = @to.convert 'C1::CONST'

assert_equal para("<a href=\"C1.html#CONST\">C1::CONST</a>"), result
end

def test_convert_RDOCLINK_rdoc_ref
result = @to.convert 'rdoc-ref:C1'

Expand Down

0 comments on commit 86c8448

Please sign in to comment.