ruby-changes:54576
From: nobu <ko1@a...>
Date: Fri, 11 Jan 2019 16:50:29 +0900 (JST)
Subject: [ruby-changes:54576] nobu:r66791 (trunk): Fix r66772
nobu 2019-01-11 16:50:23 +0900 (Fri, 11 Jan 2019) New Revision: 66791 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66791 Log: Fix r66772 Modified files: trunk/spec/ruby/core/proc/block_pass_spec.rb Index: spec/ruby/core/proc/block_pass_spec.rb =================================================================== --- spec/ruby/core/proc/block_pass_spec.rb (revision 66790) +++ spec/ruby/core/proc/block_pass_spec.rb (revision 66791) @@ -20,15 +20,19 @@ describe "Proc as a block pass argument" https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/proc/block_pass_spec.rb#L20 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 https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/proc/block_pass_spec.rb#L45 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/