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-06-27 15:51:37 +02:00
parent 64d8c0815e
commit b3fa158d1c
35 changed files with 652 additions and 56 deletions

View file

@ -57,7 +57,7 @@ describe "Proc#parameters" do
end
it "sets the first element of each sub-Array to :block for parameters prefixed with ampersands" do
->&x { }.parameters.first.first.should == :block
-> &x { }.parameters.first.first.should == :block
-> x, &y { }.parameters.last.first.should == :block
proc {|&x| }.parameters.first.first.should == :block
proc {|x,&y| }.parameters.last.first.should == :block
@ -68,7 +68,7 @@ describe "Proc#parameters" do
-> x=Math::PI { }.parameters.first.last.should == :x
-> an_argument, glark, &foo { }.parameters[1].last.should == :glark
-> *rest { }.parameters.first.last.should == :rest
->&block { }.parameters.first.last.should == :block
-> &block { }.parameters.first.last.should == :block
proc {|x| }.parameters.first.last.should == :x
proc {|x=Math::PI| }.parameters.first.last.should == :x
proc {|an_argument, glark, &foo| }.parameters[1].last.should == :glark