ruby-changes:58053
From: Yusuke <ko1@a...>
Date: Mon, 30 Sep 2019 20:26:49 +0900 (JST)
Subject: [ruby-changes:58053] 5ddc2ba13e (master): test/ruby/test_io.rb: supress a "method redefined" warning
https://git.ruby-lang.org/ruby.git/commit/?id=5ddc2ba13e From 5ddc2ba13ed6964a0383894e3728dc1bc708c404 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Mon, 30 Sep 2019 20:24:26 +0900 Subject: test/ruby/test_io.rb: supress a "method redefined" warning by explicitly removing the old definition. diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 6a27b5d..cabcc65 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -2296,6 +2296,9 @@ class TestIO < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2296 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 -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/