diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-30 04:33:28 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-30 04:33:28 +0000 |
commit | bcb5c27fc44375cde4d045f06254c58aa929e883 (patch) | |
tree | 871f63d270a0a6aa7c9f5fc6380ca15fe484419f /test/ruby/test_class.rb | |
parent | 246102b536ddd46f33162c81fa7d3e639128efbe (diff) |
* test/ruby/test_class.rb: Simplify warning checks
* test/ruby/test_io.rb: ditto
* test/ruby/test_module.rb: ditto
* test/ruby/test_regexp.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r-- | test/ruby/test_class.rb | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/test/ruby/test_class.rb b/test/ruby/test_class.rb index ef7d4fa922..7aed078654 100644 --- a/test/ruby/test_class.rb +++ b/test/ruby/test_class.rb @@ -118,23 +118,21 @@ class TestClass < Test::Unit::TestCase 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 + assert_warning '' do Class.new do def foo; end alias bar foo def foo; end end end - assert_equal("", stderr) - stderr = EnvUtil.verbose_warning do + assert_warning '' do Class.new do def foo; end alias bar foo alias bar foo end end - assert_equal("", stderr) line = __LINE__+4 stderr = EnvUtil.verbose_warning do @@ -146,22 +144,20 @@ class TestClass < Test::Unit::TestCase 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 + assert_warning '' do Class.new do define_method(:foo) do end alias bar foo alias bar foo end end - assert_equal("", stderr) - stderr = EnvUtil.verbose_warning do + assert_warning '' do Class.new do def foo; end undef foo end end - assert_equal("", stderr) end def test_check_inheritable |