mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@b0b7f53
This commit is contained in:
parent
acbe7aa197
commit
6d05967468
27 changed files with 703 additions and 76 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue