summaryrefslogtreecommitdiff
path: root/spec/ruby/core/symbol
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/core/symbol
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/symbol')
-rw-r--r--spec/ruby/core/symbol/shared/slice.rb24
-rw-r--r--spec/ruby/core/symbol/symbol_spec.rb4
-rw-r--r--spec/ruby/core/symbol/to_proc_spec.rb2
3 files changed, 15 insertions, 15 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
diff --git a/spec/ruby/core/symbol/symbol_spec.rb b/spec/ruby/core/symbol/symbol_spec.rb
index 56ce6f4a42..cefe70bc99 100644
--- a/spec/ruby/core/symbol/symbol_spec.rb
+++ b/spec/ruby/core/symbol/symbol_spec.rb
@@ -6,13 +6,13 @@ describe "Symbol" do
end
it ".allocate raises a TypeError" do
- lambda do
+ -> do
Symbol.allocate
end.should raise_error(TypeError)
end
it ".new is undefined" do
- lambda do
+ -> do
Symbol.new
end.should raise_error(NoMethodError)
end
diff --git a/spec/ruby/core/symbol/to_proc_spec.rb b/spec/ruby/core/symbol/to_proc_spec.rb
index 65f6e27be4..60e33d7cb8 100644
--- a/spec/ruby/core/symbol/to_proc_spec.rb
+++ b/spec/ruby/core/symbol/to_proc_spec.rb
@@ -18,7 +18,7 @@ describe "Symbol#to_proc" do
end
it "raises an ArgumentError when calling #call on the Proc without receiver" do
- lambda { :object_id.to_proc.call }.should raise_error(ArgumentError, "no receiver given")
+ -> { :object_id.to_proc.call }.should raise_error(ArgumentError, "no receiver given")
end
it "produces a proc that always returns [[:rest]] for #parameters" do