From 5ddc2ba13ed6964a0383894e3728dc1bc708c404 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Mon, 30 Sep 2019 20:24:26 +0900 Subject: [PATCH] test/ruby/test_io.rb: supress a "method redefined" warning by explicitly removing the old definition. --- test/ruby/test_io.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 6a27b5dc93..cabcc652c1 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -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