1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-11-13 13:17:24 +01:00
parent acbe7aa197
commit 6d05967468
27 changed files with 703 additions and 76 deletions

View file

@ -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