mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
spec: suppress deprecations of "lambda(&proc_block)" pattern
This commit is contained in:
parent
efbef729b2
commit
7ef5226520
3 changed files with 21 additions and 11 deletions
|
@ -348,7 +348,9 @@ describe "A lambda expression 'lambda { ... }'" do
|
|||
end
|
||||
|
||||
it "requires a block" do
|
||||
lambda { lambda }.should raise_error(ArgumentError)
|
||||
suppress_warning do
|
||||
lambda { lambda }.should raise_error(ArgumentError)
|
||||
end
|
||||
end
|
||||
|
||||
it "may include a rescue clause" do
|
||||
|
@ -375,9 +377,11 @@ describe "A lambda expression 'lambda { ... }'" do
|
|||
ruby_version_is "2.7" do
|
||||
it "raises ArgumentError" do
|
||||
implicit_lambda = nil
|
||||
-> {
|
||||
meth { 1 }
|
||||
}.should raise_error(ArgumentError, /tried to create Proc object without a block/)
|
||||
suppress_warning do
|
||||
-> {
|
||||
meth { 1 }
|
||||
}.should raise_error(ArgumentError, /tried to create Proc object without a block/)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue