summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-29 06:59:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-29 06:59:42 +0000
commitb29ad5f5d09113ffd34f4627647f2dd199cba37f (patch)
tree722fdece7c9a88253adf8b9afc28bf1c21dd547e /test/ruby/test_class.rb
parent19633f34bde578a4454adfb8ec117cb14abc63e9 (diff)
downloadruby-b29ad5f5d09113ffd34f4627647f2dd199cba37f.tar.gz
ruby-b29ad5f5d09113ffd34f4627647f2dd199cba37f.tar.xz
ruby-b29ad5f5d09113ffd34f4627647f2dd199cba37f.zip
* test/ruby/test_{class,module}.rb (test_method_redefinition): include
warned line number. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25151 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r--test/ruby/test_class.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb
index 7e072c27b..055ddca62 100644
--- a/test/ruby/test_class.rb
+++ b/test/ruby/test_class.rb
@@ -106,13 +106,14 @@ class TestClass < Test::Unit::TestCase
end
def test_method_redefinition
+ line = __LINE__+4
stderr = EnvUtil.verbose_warning do
Class.new do
def foo; end
def foo; end
end
end
- assert_match(/method redefined; discarding old foo/, stderr)
+ assert_match(/:#{line}: warning: method redefined; discarding old foo/, stderr)
stderr = EnvUtil.verbose_warning do
Class.new do
@@ -132,6 +133,7 @@ class TestClass < Test::Unit::TestCase
end
assert_equal("", stderr)
+ line = __LINE__+4
stderr = EnvUtil.verbose_warning do
Class.new do
define_method(:foo) do end