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/delete_spec.rb | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/string/delete_spec.rb')
-rw-r--r-- | spec/ruby/core/string/delete_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/string/delete_spec.rb b/spec/ruby/core/string/delete_spec.rb index 8725b54c3b..6136cd54af 100644 --- a/spec/ruby/core/string/delete_spec.rb +++ b/spec/ruby/core/string/delete_spec.rb @@ -14,7 +14,7 @@ describe "String#delete" do end it "raises an ArgumentError when given no arguments" do - lambda { "hell yeah".delete }.should raise_error(ArgumentError) + -> { "hell yeah".delete }.should raise_error(ArgumentError) end it "negates sets starting with ^" do @@ -62,10 +62,10 @@ describe "String#delete" do not_supported_on :opal do xFF = [0xFF].pack('C') range = "\x00 - #{xFF}".force_encoding('utf-8') - lambda { "hello".delete(range).should == "" }.should raise_error(ArgumentError) + -> { "hello".delete(range).should == "" }.should raise_error(ArgumentError) end - lambda { "hello".delete("h-e") }.should raise_error(ArgumentError) - lambda { "hello".delete("^h-e") }.should raise_error(ArgumentError) + -> { "hello".delete("h-e") }.should raise_error(ArgumentError) + -> { "hello".delete("^h-e") }.should raise_error(ArgumentError) end it "taints result when self is tainted" do @@ -86,9 +86,9 @@ describe "String#delete" do end it "raises a TypeError when one set arg can't be converted to a string" do - lambda { "hello world".delete(100) }.should raise_error(TypeError) - lambda { "hello world".delete([]) }.should raise_error(TypeError) - lambda { "hello world".delete(mock('x')) }.should raise_error(TypeError) + -> { "hello world".delete(100) }.should raise_error(TypeError) + -> { "hello world".delete([]) }.should raise_error(TypeError) + -> { "hello world".delete(mock('x')) }.should raise_error(TypeError) end it "returns subclass instances when called on a subclass" do @@ -113,7 +113,7 @@ describe "String#delete!" do a = "hello" a.freeze - lambda { a.delete!("") }.should raise_error(frozen_error_class) - lambda { a.delete!("aeiou", "^e") }.should raise_error(frozen_error_class) + -> { a.delete!("") }.should raise_error(frozen_error_class) + -> { a.delete!("aeiou", "^e") }.should raise_error(frozen_error_class) end end |