From d03771d85a77fb85d17bb072618e78a910beb594 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Jan 2019 07:50:23 +0000 Subject: [PATCH] Fix r66772 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/core/proc/block_pass_spec.rb | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/spec/ruby/core/proc/block_pass_spec.rb b/spec/ruby/core/proc/block_pass_spec.rb index 917a38efac..56d4f6ff3e 100644 --- a/spec/ruby/core/proc/block_pass_spec.rb +++ b/spec/ruby/core/proc/block_pass_spec.rb @@ -20,15 +20,19 @@ describe "Proc as a block pass argument" do end end -ruby_version_is ""..."2.7" do +ruby_version_is ""..."2.8" do describe "Proc as an implicit block pass argument" do def revivify Proc.new end it "remains the same object if re-vivified by the target method" do + warning = ruby_version_is("2.7") {/tried to create Proc object without a block/} + warning ||= '' + p = Proc.new {} - p2 = revivify(&p) + p2 = nil + -> {p2 = revivify(&p)}.should complain(warning) p.should equal p2 p.should == p2 end @@ -41,18 +45,3 @@ ruby_version_is ""..."2.7" do end end end - -ruby_version_is "2.7" do - describe "Proc called with no block" do - def revivify - Proc.new - end - - it "raises ArgumentError when called with no block" do - p = Proc.new {} - -> { - revivify(&p) - }.should - end - end -end