diff options
Diffstat (limited to 'spec/ruby/core/kernel/proc_spec.rb')
| -rw-r--r-- | spec/ruby/core/kernel/proc_spec.rb | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/spec/ruby/core/kernel/proc_spec.rb b/spec/ruby/core/kernel/proc_spec.rb index e3acfa8dfd..6553b8fd04 100644 --- a/spec/ruby/core/kernel/proc_spec.rb +++ b/spec/ruby/core/kernel/proc_spec.rb @@ -15,7 +15,7 @@ describe "Kernel.proc" do end it "returned the passed Proc if given an existing Proc" do - some_lambda = lambda {} + some_lambda = -> {} some_lambda.lambda?.should be_true l = proc(&some_lambda) l.should equal(some_lambda) @@ -36,27 +36,13 @@ describe "Kernel.proc" do end describe "Kernel#proc" do - ruby_version_is ""..."2.7" do - it "uses the implicit block from an enclosing method" do - def some_method - proc - end - - prc = some_method { "hello" } - - prc.call.should == "hello" - end + def some_method + proc end - ruby_version_is "2.7" do - it "can be created when called with no block" do - def some_method - proc - end - - -> { - some_method { "hello" } - }.should complain(/Capturing the given block using Proc.new is deprecated/) - end + it "raises an ArgumentError when passed no block" do + -> { + some_method { "hello" } + }.should raise_error(ArgumentError, 'tried to create Proc object without a block') end end |
