ruby-changes:64115
From: Yusuke <ko1@a...>
Date: Sat, 12 Dec 2020 23:12:49 +0900 (JST)
Subject: [ruby-changes:64115] efbef729b2 (master): test/ruby/test_lambda.rb: prevent lambda(&proc_block) warnings
https://git.ruby-lang.org/ruby.git/commit/?id=efbef729b2 From efbef729b2aee13241e6f7606f90d407f4530df8 Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Sat, 12 Dec 2020 23:11:47 +0900 Subject: test/ruby/test_lambda.rb: prevent lambda(&proc_block) warnings diff --git a/test/ruby/test_lambda.rb b/test/ruby/test_lambda.rb index 03b501a..8e46047 100644 --- a/test/ruby/test_lambda.rb +++ b/test/ruby/test_lambda.rb @@ -83,15 +83,21 @@ class TestLambdaParameters < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_lambda.rb#L83 end def test_create_non_lambda_for_proc_one_level + prev_warning, Warning[:deprecated] = Warning[:deprecated], false f = pass_along {} refute_predicate(f, :lambda?, '[Bug #15620]') assert_nothing_raised(ArgumentError) { f.call(:extra_arg) } + ensure + Warning[:deprecated] = prev_warning end def test_create_non_lambda_for_proc_two_levels + prev_warning, Warning[:deprecated] = Warning[:deprecated], false f = pass_along2 {} refute_predicate(f, :lambda?, '[Bug #15620]') assert_nothing_raised(ArgumentError) { f.call(:extra_arg) } + ensure + Warning[:deprecated] = prev_warning end def test_instance_exec -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/