diff options
author | Benoit Daloze <[email protected]> | 2020-11-13 13:17:24 +0100 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2020-11-13 13:17:24 +0100 |
commit | 6d05967468ea58ba481259718f07b3cb5a386945 (patch) | |
tree | e21976cdae28f91bcac002dc463a099ca64d111d /spec/ruby/shared/enumerator/enum_for.rb | |
parent | acbe7aa19705905e7ad1952395e98e8bfe583a97 (diff) |
Update to ruby/spec@b0b7f53
Diffstat (limited to 'spec/ruby/shared/enumerator/enum_for.rb')
-rw-r--r-- | spec/ruby/shared/enumerator/enum_for.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/ruby/shared/enumerator/enum_for.rb b/spec/ruby/shared/enumerator/enum_for.rb index 9030ffbd7d..a67a76c461 100644 --- a/spec/ruby/shared/enumerator/enum_for.rb +++ b/spec/ruby/shared/enumerator/enum_for.rb @@ -12,6 +12,13 @@ describe :enum_for, shared: true do enum.map { |v| v }.should == [1,2].each { |v| v } end + it "sets regexp matches in the caller" do + "wawa".send(@method, :scan, /./).map {|o| $& }.should == ["w", "a", "w", "a"] + a = [] + "wawa".send(@method, :scan, /./).each {|o| a << $& } + a.should == ["w", "a", "w", "a"] + end + it "exposes multi-arg yields as an array" do o = Object.new def o.each |