diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-11 07:50:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-11 07:50:23 +0000 |
commit | d03771d85a77fb85d17bb072618e78a910beb594 (patch) | |
tree | 8edc545803d5d85f57f6446d876193a89d55ff67 /spec/ruby/core/proc/block_pass_spec.rb | |
parent | e4f46eabab70bfcde67f0032a902433d11afc166 (diff) | |
download | ruby-d03771d85a77fb85d17bb072618e78a910beb594.tar.gz |
Fix r66772
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/core/proc/block_pass_spec.rb')
-rw-r--r-- | spec/ruby/core/proc/block_pass_spec.rb | 23 |
1 files 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 |