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

test/ruby/test_proc.rb: suppress "method redefined" warnings

This commit is contained in:
Yusuke Endoh 2019-11-14 13:00:25 +09:00
parent 179062dd80
commit 48edaf8b8a

View file

@ -58,7 +58,10 @@ class TestProc < Test::Unit::TestCase
b = assert_warn(/Capturing the given block using Proc\.new is deprecated/) do
Proc.new
end
meta.class_eval {define_method(:foo, b)}
meta.class_eval {
remove_method(:foo) if method_defined?(:foo)
define_method(:foo, b)
}
assert_equal(n, method(:foo).arity)
end