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

support multi-run for test/ruby/test_proc.rb

Mysterious error:
`remove_method(:foo) if method_defined?(:foo)` raise an exception
`method `foo' not defined in #<Class:#<TestProc:0x000055d12ff154e0>>`
This patch rename the method name foo to foo_arity to solve it.
This commit is contained in:
Koichi Sasada 2020-01-28 14:21:44 +09:00
parent 1bc731cb65
commit 56b0300f24

View file

@ -59,10 +59,10 @@ class TestProc < Test::Unit::TestCase
Proc.new
end
meta.class_eval {
remove_method(:foo) if method_defined?(:foo)
define_method(:foo, b)
remove_method(:foo_arity) if method_defined?(:foo_arity)
define_method(:foo_arity, b)
}
assert_equal(n, method(:foo).arity)
assert_equal(n, method(:foo_arity).arity)
end
def test_arity