mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@8cafaa5
This commit is contained in:
parent
1b377b32c8
commit
2e32b919b4
35 changed files with 832 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue