summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorYusuke Endoh <mame@ruby-lang.org>2021-11-09 17:30:28 +0900
committerYusuke Endoh <mame@ruby-lang.org>2021-11-09 17:30:28 +0900
commitcf50f9484af9b7aa5afd7a342026d86d1906c423 (patch)
tree461d59424635a360635f74719881d2024d755968 /test
parentd5ae892519a1944b4869d06d1523648cf6e15d97 (diff)
downloadruby-cf50f9484af9b7aa5afd7a342026d86d1906c423.tar.gz
test/ruby/test_enum.rb: Prevent a warning
http://rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20211109T063003Z.log.html.gz ``` [ 1960/21145] TestEnumerable#test_to_a_keywords/home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_enum.rb:138: warning: method redefined; discarding old each /home/chkbuild/chkbuild/tmp/build/20211109T063003Z/ruby/test/ruby/test_enum.rb:11: warning: previous definition of each was here = 0.00 s ```
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_enum.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index c4706323fd..b71ed54653 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -135,6 +135,7 @@ class TestEnumerable < Test::Unit::TestCase
end
def test_to_a_keywords
+ @obj.singleton_class.remove_method(:each)
def @obj.each(foo:) yield foo end
assert_equal([1], @obj.to_a(foo: 1))
end