Skip to content

Commit

Permalink
Add spec for capturing Kernel#lambda with Kernel#method
Browse files Browse the repository at this point in the history
  • Loading branch information
XrXr committed Dec 21, 2019
1 parent e0b336c commit ddb6023
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions spec/ruby/core/kernel/lambda_spec.rb
Expand Up @@ -53,6 +53,13 @@
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
Expand Down

0 comments on commit ddb6023

Please sign in to comment.