diff options
Diffstat (limited to 'spec/ruby/core/env/shared/store.rb')
-rw-r--r-- | spec/ruby/core/env/shared/store.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/ruby/core/env/shared/store.rb b/spec/ruby/core/env/shared/store.rb index 6ae91ef8fc..d6265c66a5 100644 --- a/spec/ruby/core/env/shared/store.rb +++ b/spec/ruby/core/env/shared/store.rb @@ -1,6 +1,10 @@ describe :env_store, shared: true do + before :each do + @saved_foo = ENV["foo"] + end + after :each do - ENV.delete("foo") + ENV["foo"] = @saved_foo end it "sets the environment variable to the given value" do @@ -34,11 +38,11 @@ describe :env_store, shared: true do end it "raises TypeError when the key is not coercible to String" do - -> { ENV.send(@method, Object.new, "bar") }.should raise_error(TypeError) + -> { ENV.send(@method, Object.new, "bar") }.should raise_error(TypeError, "no implicit conversion of Object into String") end it "raises TypeError when the value is not coercible to String" do - -> { ENV.send(@method, "foo", Object.new) }.should raise_error(TypeError) + -> { ENV.send(@method, "foo", Object.new) }.should raise_error(TypeError, "no implicit conversion of Object into String") end it "raises Errno::EINVAL when the key contains the '=' character" do |