From f3e927b0cc1fcbf03abea7f66b1a3736a270a8de Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Wed, 10 Jun 2020 15:17:54 -0700 Subject: Make proc/Proc.new without block an error instead of warning The warning for these was added in 2.7. --- bootstraptest/test_flow.rb | 8 ++++---- bootstraptest/test_proc.rb | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'bootstraptest') diff --git a/bootstraptest/test_flow.rb b/bootstraptest/test_flow.rb index 9da6d45cbd..35f19db588 100644 --- a/bootstraptest/test_flow.rb +++ b/bootstraptest/test_flow.rb @@ -534,11 +534,11 @@ assert_equal %Q{ENSURE\n}, %q{ ['[ruby-core:39125]', %q{ class Bug5234 include Enumerable - def each + def each(&block) begin yield :foo ensure - proc + proc(&block) end end end @@ -547,11 +547,11 @@ assert_equal %Q{ENSURE\n}, %q{ ['[ruby-dev:45656]', %q{ class Bug6460 include Enumerable - def each + def each(&block) begin yield :foo ensure - 1.times { Proc.new } + 1.times { Proc.new(&block) } end end end diff --git a/bootstraptest/test_proc.rb b/bootstraptest/test_proc.rb index 6d2c557c3c..637603243d 100644 --- a/bootstraptest/test_proc.rb +++ b/bootstraptest/test_proc.rb @@ -367,8 +367,8 @@ assert_equal 'ok', %q{ assert_equal 'ok', %q{ class Foo - def call_it - p = Proc.new + def call_it(&block) + p = Proc.new(&block) p.call end end -- cgit v1.2.3