diff options
author | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/language/next_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/language/next_spec.rb')
-rw-r--r-- | spec/ruby/language/next_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/language/next_spec.rb b/spec/ruby/language/next_spec.rb index e0a0265ac6..6fbfc4a54d 100644 --- a/spec/ruby/language/next_spec.rb +++ b/spec/ruby/language/next_spec.rb @@ -8,7 +8,7 @@ describe "The next statement from within the block" do it "ends block execution" do a = [] - lambda { + -> { a << 1 next a << 2 @@ -17,15 +17,15 @@ describe "The next statement from within the block" do end it "causes block to return nil if invoked without arguments" do - lambda { 123; next; 456 }.call.should == nil + -> { 123; next; 456 }.call.should == nil end it "causes block to return nil if invoked with an empty expression" do - lambda { next (); 456 }.call.should be_nil + -> { next (); 456 }.call.should be_nil end it "returns the argument passed" do - lambda { 123; next 234; 345 }.call.should == 234 + -> { 123; next 234; 345 }.call.should == 234 end it "returns to the invoking method" do @@ -102,14 +102,14 @@ describe "The next statement from within the block" do it "passes the value returned by a method with omitted parenthesis and passed block" do obj = NextSpecs::Block.new - lambda { next obj.method :value do |x| x end }.call.should == :value + -> { next obj.method :value do |x| x end }.call.should == :value end end describe "The next statement" do describe "in a method" do it "is invalid and raises a SyntaxError" do - lambda { + -> { eval("def m; next; end") }.should raise_error(SyntaxError) end |