Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/rdoc/any_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,12 @@ def deduplicate_call_seq(call_seq)
ignore << is_alias_for.name
ignore.concat is_alias_for.aliases.map(&:name)
end
ignore.map! { |n| n =~ /\A\[/ ? n[0, 1] : n}
ignore.map! { |n| n =~ /\A\[/ ? /\[.*\]/ : n}
ignore.delete(method_name)
ignore = Regexp.union(ignore)

matching = entries.reject do |entry|
entry =~ /^\w*\.?#{ignore}/ or
entry =~ /^\w*\.?#{ignore}[$\(\s]/ or
entry =~ /\s#{ignore}\s/
end

Expand Down
14 changes: 14 additions & 0 deletions test/rdoc/test_rdoc_any_method.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@ def test_call_seq_equals
assert_equal 'foo', m.call_seq
end

def test_call_seq_alias_for
a = RDoc::AnyMethod.new nil, "each"
m = RDoc::AnyMethod.new nil, "each_line"

a.call_seq = <<-CALLSEQ
each(foo)
each_line(foo)
CALLSEQ

m.is_alias_for = a

assert_equal "each_line(foo)", m.call_seq
end

def test_full_name
assert_equal 'C1::m', @c1.method_list.first.full_name
end
Expand Down