Skip to content

Commit 48edaf8

Browse files
committed
test/ruby/test_proc.rb: suppress "method redefined" warnings
1 parent 179062d commit 48edaf8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/ruby/test_proc.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ def assert_arity(n)
5858
b = assert_warn(/Capturing the given block using Proc\.new is deprecated/) do
5959
Proc.new
6060
end
61-
meta.class_eval {define_method(:foo, b)}
61+
meta.class_eval {
62+
remove_method(:foo) if method_defined?(:foo)
63+
define_method(:foo, b)
64+
}
6265
assert_equal(n, method(:foo).arity)
6366
end
6467

0 commit comments

Comments
 (0)