summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/index_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/string/index_spec.rb
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/string/index_spec.rb')
-rw-r--r--spec/ruby/core/string/index_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/string/index_spec.rb b/spec/ruby/core/string/index_spec.rb
index fb5f4e75e7..ca62911db0 100644
--- a/spec/ruby/core/string/index_spec.rb
+++ b/spec/ruby/core/string/index_spec.rb
@@ -4,15 +4,15 @@ require_relative 'fixtures/classes'
describe "String#index" do
it "raises a TypeError if passed nil" do
- lambda { "abc".index nil }.should raise_error(TypeError)
+ -> { "abc".index nil }.should raise_error(TypeError)
end
it "raises a TypeError if passed a boolean" do
- lambda { "abc".index true }.should raise_error(TypeError)
+ -> { "abc".index true }.should raise_error(TypeError)
end
it "raises a TypeError if passed a Symbol" do
- lambda { "abc".index :a }.should raise_error(TypeError)
+ -> { "abc".index :a }.should raise_error(TypeError)
end
it "calls #to_str to convert the first argument" do
@@ -28,7 +28,7 @@ describe "String#index" do
end
it "raises a TypeError if passed a Fixnum" do
- lambda { "abc".index 97 }.should raise_error(TypeError)
+ -> { "abc".index 97 }.should raise_error(TypeError)
end
end
@@ -154,7 +154,7 @@ describe "String#index with String" do
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
char = "れ".encode Encoding::EUC_JP
- lambda do
+ -> do
"あれ".index char
end.should raise_error(Encoding::CompatibilityError)
end
@@ -305,7 +305,7 @@ describe "String#index with Regexp" do
it "raises an Encoding::CompatibilityError if the encodings are incompatible" do
re = Regexp.new "れ".encode(Encoding::EUC_JP)
- lambda do
+ -> do
"あれ".index re
end.should raise_error(Encoding::CompatibilityError)
end