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 2021-01-28 17:08:57 +01:00
parent 1b377b32c8
commit 2e32b919b4
35 changed files with 832 additions and 10 deletions

View file

@ -123,4 +123,16 @@ describe "Kernel.lambda" do
it "allows long returns to flow through it" do
KernelSpecs::Lambda.new.outer.should == :good
end
it "treats the block as a Proc when lambda is re-defined" do
klass = Class.new do
def lambda (&block); block; end
def ret
lambda { return 1 }.call
2
end
end
klass.new.lambda { 42 }.should be_an_instance_of Proc
klass.new.ret.should == 1
end
end