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

test/ruby/test_io.rb: supress a "method redefined" warning

by explicitly removing the old definition.
This commit is contained in:
Yusuke Endoh 2019-09-30 20:24:26 +09:00
parent fc66947c61
commit 5ddc2ba13e

View file

@ -2296,6 +2296,9 @@ class TestIO < Test::Unit::TestCase
assert_equal({:a=>1}, open(o, {a: 1}))
end
class << o
remove_method(:to_open)
end
def o.to_open(kw); kw; end
assert_equal({:a=>1}, open(o, a: 1))
unless redefined