summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-13 22:57:31 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-06-13 22:57:31 +0900
commit1efc3d6d65405631630e32bdcc5274bb49f44222 (patch)
tree1a13591434da2ccf6df26cc3428b4db52b8de154 /spec/ruby/core/kernel
parent1f1b62fb7bb0855788f3da7fdcf9e440ff617fb3 (diff)
Suppress warnings [Feature #15973]
Diffstat (limited to 'spec/ruby/core/kernel')
-rw-r--r--spec/ruby/core/kernel/fixtures/classes.rb2
-rw-r--r--spec/ruby/core/kernel/lambda_spec.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/spec/ruby/core/kernel/fixtures/classes.rb b/spec/ruby/core/kernel/fixtures/classes.rb
index 623b45ca34..8702c925c8 100644
--- a/spec/ruby/core/kernel/fixtures/classes.rb
+++ b/spec/ruby/core/kernel/fixtures/classes.rb
@@ -350,7 +350,7 @@ module KernelSpecs
module Ampersand
def lambda(&block)
- super(&block)
+ suppress_warning {super(&block)}
end
end
diff --git a/spec/ruby/core/kernel/lambda_spec.rb b/spec/ruby/core/kernel/lambda_spec.rb
index 5c30511270..dfe36cefaa 100644
--- a/spec/ruby/core/kernel/lambda_spec.rb
+++ b/spec/ruby/core/kernel/lambda_spec.rb
@@ -33,7 +33,7 @@ describe "Kernel.lambda" do
it "returns the passed Proc if given an existing Proc" do
some_proc = proc {}
- l = lambda(&some_proc)
+ l = suppress_warning {lambda(&some_proc)}
l.should equal(some_proc)
l.lambda?.should be_false
end
@@ -55,7 +55,7 @@ describe "Kernel.lambda" do
it "does not create lambda-style Procs when captured with #method" do
kernel_lambda = method(:lambda)
- l = kernel_lambda.call { 42 }
+ l = suppress_warning {kernel_lambda.call { 42 }}
l.lambda?.should be_false
l.call(:extra).should == 42
end