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/env | |
parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
download | ruby-5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0.tar.gz |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/env')
-rw-r--r-- | spec/ruby/core/env/fetch_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/core/env/reject_spec.rb | 4 | ||||
-rw-r--r-- | spec/ruby/core/env/shared/store.rb | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/core/env/fetch_spec.rb b/spec/ruby/core/env/fetch_spec.rb index c8a11430ab..eeaf290cf0 100644 --- a/spec/ruby/core/env/fetch_spec.rb +++ b/spec/ruby/core/env/fetch_spec.rb @@ -9,11 +9,11 @@ describe "ENV.fetch" do end it "raises a TypeError if the key is not a String" do - lambda { ENV.fetch :should_never_be_set }.should raise_error(TypeError) + -> { ENV.fetch :should_never_be_set }.should raise_error(TypeError) end context "when the key is not found" do - it_behaves_like :key_error, ->(obj, key) { obj.fetch(key) }, ENV + it_behaves_like :key_error, -> obj, key { obj.fetch(key) }, ENV it "formats the object with #inspect in the KeyError message" do -> { @@ -31,7 +31,7 @@ describe "ENV.fetch" do end it "warns on block and default parameter given" do - lambda do + -> do ENV.fetch("should_never_be_set", "default") { 1 }.should == 1 end.should complain(/block supersedes default value argument/) end diff --git a/spec/ruby/core/env/reject_spec.rb b/spec/ruby/core/env/reject_spec.rb index 409efa1385..1026c2f451 100644 --- a/spec/ruby/core/env/reject_spec.rb +++ b/spec/ruby/core/env/reject_spec.rb @@ -29,7 +29,7 @@ describe "ENV.reject!" do orig = ENV.to_hash begin ENV.clear - lambda { ENV.reject! }.should_not raise_error(LocalJumpError) + -> { ENV.reject! }.should_not raise_error(LocalJumpError) ensure ENV.replace orig end @@ -67,7 +67,7 @@ describe "ENV.reject" do orig = ENV.to_hash begin ENV.clear - lambda { ENV.reject }.should_not raise_error(LocalJumpError) + -> { ENV.reject }.should_not raise_error(LocalJumpError) ensure ENV.replace orig end diff --git a/spec/ruby/core/env/shared/store.rb b/spec/ruby/core/env/shared/store.rb index 4949ca8c73..6ae91ef8fc 100644 --- a/spec/ruby/core/env/shared/store.rb +++ b/spec/ruby/core/env/shared/store.rb @@ -34,19 +34,19 @@ describe :env_store, shared: true do end it "raises TypeError when the key is not coercible to String" do - lambda { ENV.send(@method, Object.new, "bar") }.should raise_error(TypeError) + -> { ENV.send(@method, Object.new, "bar") }.should raise_error(TypeError) end it "raises TypeError when the value is not coercible to String" do - lambda { ENV.send(@method, "foo", Object.new) }.should raise_error(TypeError) + -> { ENV.send(@method, "foo", Object.new) }.should raise_error(TypeError) end it "raises Errno::EINVAL when the key contains the '=' character" do - lambda { ENV.send(@method, "foo=", "bar") }.should raise_error(Errno::EINVAL) + -> { ENV.send(@method, "foo=", "bar") }.should raise_error(Errno::EINVAL) end it "raises Errno::EINVAL when the key is an empty string" do - lambda { ENV.send(@method, "", "bar") }.should raise_error(Errno::EINVAL) + -> { ENV.send(@method, "", "bar") }.should raise_error(Errno::EINVAL) end it "does nothing when the key is not a valid environment variable key and the value is nil" do |