diff options
Diffstat (limited to 'spec/ruby/core/symbol/shared/slice.rb')
-rw-r--r-- | spec/ruby/core/symbol/shared/slice.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/ruby/core/symbol/shared/slice.rb b/spec/ruby/core/symbol/shared/slice.rb index 80e1fd3ddc..478e0d80ae 100644 --- a/spec/ruby/core/symbol/shared/slice.rb +++ b/spec/ruby/core/symbol/shared/slice.rb @@ -74,21 +74,21 @@ describe :symbol_slice, shared: true do describe "and a nil length" do it "raises a TypeError" do - lambda { :symbol.send(@method, 1,nil) }.should raise_error(TypeError) + -> { :symbol.send(@method, 1,nil) }.should raise_error(TypeError) end end describe "and a length that cannot be converted into an Integer" do it "raises a TypeError when given an Array" do - lambda { :symbol.send(@method, 1,Array.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, 1,Array.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Hash" do - lambda { :symbol.send(@method, 1,Hash.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, 1,Hash.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Object" do - lambda { :symbol.send(@method, 1,Object.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, 1,Object.new) }.should raise_error(TypeError) end end end @@ -101,21 +101,21 @@ describe :symbol_slice, shared: true do describe "with a nil index" do it "raises a TypeError" do - lambda { :symbol.send(@method, nil) }.should raise_error(TypeError) + -> { :symbol.send(@method, nil) }.should raise_error(TypeError) end end describe "with an index that cannot be converted into an Integer" do it "raises a TypeError when given an Array" do - lambda { :symbol.send(@method, Array.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, Array.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Hash" do - lambda { :symbol.send(@method, Hash.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, Hash.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Object" do - lambda { :symbol.send(@method, Object.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, Object.new) }.should raise_error(TypeError) end end @@ -229,20 +229,20 @@ describe :symbol_slice, shared: true do describe "and an index that cannot be converted to an Integer" do it "raises a TypeError when given an Hash" do - lambda { :symbol.send(@method, /(sy)(mb)(ol)/, Hash.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, /(sy)(mb)(ol)/, Hash.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Array" do - lambda { :symbol.send(@method, /(sy)(mb)(ol)/, Array.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, /(sy)(mb)(ol)/, Array.new) }.should raise_error(TypeError) end it "raises a TypeError when given an Object" do - lambda { :symbol.send(@method, /(sy)(mb)(ol)/, Object.new) }.should raise_error(TypeError) + -> { :symbol.send(@method, /(sy)(mb)(ol)/, Object.new) }.should raise_error(TypeError) end end it "raises a TypeError if the index is nil" do - lambda { :symbol.send(@method, /(sy)(mb)(ol)/, nil) }.should raise_error(TypeError) + -> { :symbol.send(@method, /(sy)(mb)(ol)/, nil) }.should raise_error(TypeError) end it "sets $~ to the MatchData if there is a match" do |