diff options
-rw-r--r-- | lib/rdoc/any_method.rb | 4 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_any_method.rb | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index 0b7dd717ab..051f946a10 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -350,12 +350,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr 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 diff --git a/test/rdoc/test_rdoc_any_method.rb b/test/rdoc/test_rdoc_any_method.rb index 826ef1c8d8..6915b466f0 100644 --- a/test/rdoc/test_rdoc_any_method.rb +++ b/test/rdoc/test_rdoc_any_method.rb @@ -51,6 +51,20 @@ method(a, b) { |c, d| ... } 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 |