1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* vm_method.c (rb_add_method_def): show the location where

overwritten method was defined.  [ruby-dev:39400]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-09-30 04:15:46 +00:00
parent 331fdbe822
commit a71d47a380
5 changed files with 37 additions and 3 deletions

View file

@ -106,6 +106,8 @@ class TestClass < Test::Unit::TestCase
end
def test_method_redefinition
feature2155 = '[ruby-dev:39400]'
line = __LINE__+4
stderr = EnvUtil.verbose_warning do
Class.new do
@ -114,6 +116,7 @@ class TestClass < Test::Unit::TestCase
end
end
assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
assert_match(/:#{line-1}: warning: previous definition of foo/, stderr, feature2155)
stderr = EnvUtil.verbose_warning do
Class.new do
@ -141,6 +144,7 @@ class TestClass < Test::Unit::TestCase
end
end
assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
assert_match(/:#{line-1}: warning: previous definition of foo/, stderr, feature2155)
stderr = EnvUtil.verbose_warning do
Class.new do