Sha256: 19886a195b7973e216303596479ddf95e215206b158676ac00bddc8a8beb7c2c
Contents?: true
Size: 744 Bytes
Versions: 60
Compression:
Stored size: 744 Bytes
Contents
describe "Proc#[]" do it "invokes self" do Proc.new { "test!" }[].should == "test!" lambda { "test!" }[].should == "test!" proc { "test!" }[].should == "test!" end it "sets self's parameters to the given values" do Proc.new { |a, b| a + b }[1, 2].should == 3 Proc.new { |*args| args }[1, 2, 3, 4].should == [1, 2, 3, 4] Proc.new { |_, *args| args }[1, 2, 3].should == [2, 3] lambda { |a, b| a + b }[1, 2].should == 3 lambda { |*args| args }[1, 2, 3, 4].should == [1, 2, 3, 4] lambda { |_, *args| args }[1, 2, 3].should == [2, 3] proc { |a, b| a + b }[1, 2].should == 3 proc { |*args| args }[1, 2, 3, 4].should == [1, 2, 3, 4] proc { |_, *args| args }[1, 2, 3].should == [2, 3] end end
Version data entries
60 entries across 60 versions & 3 rubygems