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:
parent
179062dd80
commit
48edaf8b8a
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue