diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-05-28 22:41:48 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-05-28 22:41:48 +0200 |
commit | a66bc2c01194a9c017c874a30db5b3b6bd95e966 (patch) | |
tree | 598d6375b44fd86f90c3477c73086f6fcf08d76c /spec/ruby/core/enumerable | |
parent | d070523e7be4b95914adeef9a10401fba7718c5a (diff) | |
download | ruby-a66bc2c01194a9c017c874a30db5b3b6bd95e966.tar.gz |
Update to ruby/spec@9a501a8
Diffstat (limited to 'spec/ruby/core/enumerable')
-rw-r--r-- | spec/ruby/core/enumerable/shared/find.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/ruby/core/enumerable/shared/find.rb b/spec/ruby/core/enumerable/shared/find.rb index 5c097509cd..3435ce3658 100644 --- a/spec/ruby/core/enumerable/shared/find.rb +++ b/spec/ruby/core/enumerable/shared/find.rb @@ -49,6 +49,10 @@ describe :enumerable_find, shared: true do @empty.send(@method, fail_proc) {|e| true}.should == "yay" end + it "ignores the ifnone argument when nil" do + @numerous.send(@method, nil) {|e| false }.should == nil + end + it "passes through the values yielded by #each_with_index" do [:a, :b].each_with_index.send(@method) { |x, i| ScratchPad << [x, i]; nil } ScratchPad.recorded.should == [[:a, 0], [:b, 1]] |