diff options
Diffstat (limited to 'spec/ruby/core/kernel/lambda_spec.rb')
-rw-r--r-- | spec/ruby/core/kernel/lambda_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/ruby/core/kernel/lambda_spec.rb b/spec/ruby/core/kernel/lambda_spec.rb index dfe36cefaa..4dd34c6ca9 100644 --- a/spec/ruby/core/kernel/lambda_spec.rb +++ b/spec/ruby/core/kernel/lambda_spec.rb @@ -27,8 +27,10 @@ describe "Kernel.lambda" do end it "creates a lambda-style Proc if given a literal block via Kernel.public_send" do - l = Kernel.public_send(:lambda) { 42 } - l.lambda?.should be_true + suppress_warning do + l = Kernel.public_send(:lambda) { 42 } + l.lambda?.should be_true + end end it "returns the passed Proc if given an existing Proc" do @@ -39,11 +41,13 @@ describe "Kernel.lambda" do end it "creates a lambda-style Proc when called with zsuper" do - l = KernelSpecs::LambdaSpecs::ForwardBlockWithZSuper.new.lambda { 42 } - l.lambda?.should be_true - l.call.should == 42 + suppress_warning do + l = KernelSpecs::LambdaSpecs::ForwardBlockWithZSuper.new.lambda { 42 } + l.lambda?.should be_true + l.call.should == 42 - lambda { l.call(:extra) }.should raise_error(ArgumentError) + lambda { l.call(:extra) }.should raise_error(ArgumentError) + end end it "returns the passed Proc if given an existing Proc through super" do |