summaryrefslogtreecommitdiff
path: root/spec/bundler/environment_preserver_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/environment_preserver_spec.rb')
-rw-r--r--spec/bundler/environment_preserver_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/bundler/environment_preserver_spec.rb b/spec/bundler/environment_preserver_spec.rb
index b3e7019a75..0c2913cc37 100644
--- a/spec/bundler/environment_preserver_spec.rb
+++ b/spec/bundler/environment_preserver_spec.rb
@@ -32,6 +32,18 @@ describe Bundler::EnvironmentPreserver do
expect(subject.key?("BUNDLE_ORIG_foo")).to eq(false)
end
end
+
+ context "when an original key is set" do
+ let(:env) { { "foo" => "my-foo", "BUNDLE_ORIG_foo" => "orig-foo" } }
+
+ it "should keep the original value in the BUNDLE_ORIG_ variable" do
+ expect(subject["BUNDLE_ORIG_foo"]).to eq("orig-foo")
+ end
+
+ it "should keep the variable" do
+ expect(subject["foo"]).to eq("my-foo")
+ end
+ end
end
describe "#restore" do