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/core/string/rindex_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/string/rindex_spec.rb')
-rw-r--r-- | spec/ruby/core/string/rindex_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/string/rindex_spec.rb b/spec/ruby/core/string/rindex_spec.rb index f74c0115cc..e021486bc2 100644 --- a/spec/ruby/core/string/rindex_spec.rb +++ b/spec/ruby/core/string/rindex_spec.rb @@ -6,15 +6,15 @@ require_relative 'fixtures/utf-8-encoding' describe "String#rindex with object" do it "raises a TypeError if obj isn't a String, Fixnum or Regexp" do not_supported_on :opal do - lambda { "hello".rindex(:sym) }.should raise_error(TypeError) + -> { "hello".rindex(:sym) }.should raise_error(TypeError) end - lambda { "hello".rindex(mock('x')) }.should raise_error(TypeError) + -> { "hello".rindex(mock('x')) }.should raise_error(TypeError) end it "doesn't try to convert obj to an integer via to_int" do obj = mock('x') obj.should_not_receive(:to_int) - lambda { "hello".rindex(obj) }.should raise_error(TypeError) + -> { "hello".rindex(obj) }.should raise_error(TypeError) end it "tries to convert obj to a string via to_str" do @@ -190,7 +190,7 @@ describe "String#rindex with String" do end it "raises a TypeError when given offset is nil" do - lambda { "str".rindex("st", nil) }.should raise_error(TypeError) + -> { "str".rindex("st", nil) }.should raise_error(TypeError) end end @@ -344,7 +344,7 @@ describe "String#rindex with Regexp" do end it "raises a TypeError when given offset is nil" do - lambda { "str".rindex(/../, nil) }.should raise_error(TypeError) + -> { "str".rindex(/../, nil) }.should raise_error(TypeError) end it "returns the reverse character index of a multibyte character" do @@ -359,7 +359,7 @@ describe "String#rindex with Regexp" do it "raises an Encoding::CompatibilityError if the encodings are incompatible" do re = Regexp.new "れ".encode(Encoding::EUC_JP) - lambda do + -> do "あれ".rindex re end.should raise_error(Encoding::CompatibilityError) end |