summaryrefslogtreecommitdiff
path: root/test/ruby/test_class.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_class.rb')
-rw-r--r--test/ruby/test_class.rb12
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