summaryrefslogtreecommitdiff
path: root/spec/ruby/language/break_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
committerBenoit Daloze <[email protected]>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/language/break_spec.rb
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/language/break_spec.rb')
-rw-r--r--spec/ruby/language/break_spec.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/ruby/language/break_spec.rb b/spec/ruby/language/break_spec.rb
index 8fd6cc6f05..754d5d3c49 100644
--- a/spec/ruby/language/break_spec.rb
+++ b/spec/ruby/language/break_spec.rb
@@ -52,29 +52,29 @@ describe "The break statement in a captured block" do
describe "when the invocation of the scope creating the block is still active" do
it "raises a LocalJumpError when invoking the block from the scope creating the block" do
- lambda { @program.break_in_method }.should raise_error(LocalJumpError)
+ -> { @program.break_in_method }.should raise_error(LocalJumpError)
ScratchPad.recorded.should == [:a, :xa, :d, :b]
end
it "raises a LocalJumpError when invoking the block from a method" do
- lambda { @program.break_in_nested_method }.should raise_error(LocalJumpError)
+ -> { @program.break_in_nested_method }.should raise_error(LocalJumpError)
ScratchPad.recorded.should == [:a, :xa, :cc, :aa, :b]
end
it "raises a LocalJumpError when yielding to the block" do
- lambda { @program.break_in_yielding_method }.should raise_error(LocalJumpError)
+ -> { @program.break_in_yielding_method }.should raise_error(LocalJumpError)
ScratchPad.recorded.should == [:a, :xa, :cc, :aa, :b]
end
end
describe "from a scope that has returned" do
it "raises a LocalJumpError when calling the block from a method" do
- lambda { @program.break_in_method_captured }.should raise_error(LocalJumpError)
+ -> { @program.break_in_method_captured }.should raise_error(LocalJumpError)
ScratchPad.recorded.should == [:a, :za, :xa, :zd, :zb]
end
it "raises a LocalJumpError when yielding to the block" do
- lambda { @program.break_in_yield_captured }.should raise_error(LocalJumpError)
+ -> { @program.break_in_yield_captured }.should raise_error(LocalJumpError)
ScratchPad.recorded.should == [:a, :za, :xa, :zd, :aa, :zb]
end
end
@@ -100,7 +100,7 @@ describe "The break statement in a lambda" do
end
it "returns from the lambda" do
- l = lambda {
+ l = -> {
ScratchPad << :before
break :foo
ScratchPad << :after
@@ -111,7 +111,7 @@ describe "The break statement in a lambda" do
it "returns from the call site if the lambda is passed as a block" do
def mid(&b)
- lambda {
+ -> {
ScratchPad << :before
b.call
ScratchPad << :unreachable1
@@ -208,7 +208,7 @@ describe "Break inside a while loop" do
it "passes the value returned by a method with omitted parenthesis and passed block" do
obj = BreakSpecs::Block.new
- lambda { break obj.method :value do |x| x end }.call.should == :value
+ -> { break obj.method :value do |x| x end }.call.should == :value
end
end