mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 11:33:58 +02:00
test/ruby/test_enum.rb: Prevent a warning
20211109
T063003Z.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
```
This commit is contained in:
parent
d5ae892519
commit
cf50f9484a
1 changed files with 1 additions and 0 deletions
|
@ -135,6 +135,7 @@ class TestEnumerable < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_to_a_keywords
|
def test_to_a_keywords
|
||||||
|
@obj.singleton_class.remove_method(:each)
|
||||||
def @obj.each(foo:) yield foo end
|
def @obj.each(foo:) yield foo end
|
||||||
assert_equal([1], @obj.to_a(foo: 1))
|
assert_equal([1], @obj.to_a(foo: 1))
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue