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
Родитель fc66947c61
Коммит 5ddc2ba13e
1 изменённых файлов: 3 добавлений и 0 удалений

Просмотреть файл

@ -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