diff options
Diffstat (limited to 'spec/ruby/core/string/index_spec.rb')
-rw-r--r-- | spec/ruby/core/string/index_spec.rb | 12 |
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 |