mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_lambda.rb: prevent lambda(&proc_block) warnings
This commit is contained in:
parent
248f1ef282
commit
efbef729b2
1 changed files with 6 additions and 0 deletions
|
@ -83,15 +83,21 @@ class TestLambdaParameters < Test::Unit::TestCase
|
|||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue