mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Add spec for capturing Kernel#lambda with Kernel#method
This commit is contained in:
parent
e0b336c8ce
commit
ddb6023d64
Notes:
git
2019-12-21 23:09:17 +09:00
1 changed files with 7 additions and 0 deletions
|
@ -53,6 +53,13 @@ describe "Kernel.lambda" do
|
|||
l.lambda?.should be_false
|
||||
end
|
||||
|
||||
it "does not create lambda-style Procs when captured with #method" do
|
||||
kernel_lambda = method(:lambda)
|
||||
l = kernel_lambda.call { 42 }
|
||||
l.lambda?.should be_false
|
||||
l.call(:extra).should == 42
|
||||
end
|
||||
|
||||
it "checks the arity of the call when no args are specified" do
|
||||
l = lambda { :called }
|
||||
l.call.should == :called
|
||||
|
|
Loading…
Add table
Reference in a new issue