summaryrefslogtreecommitdiff
path: root/spec/runtime/with_clean_env_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/runtime/with_clean_env_spec.rb')
-rw-r--r--spec/runtime/with_clean_env_spec.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/runtime/with_clean_env_spec.rb b/spec/runtime/with_clean_env_spec.rb
index 5cd9f264c2..78eebaff79 100644
--- a/spec/runtime/with_clean_env_spec.rb
+++ b/spec/runtime/with_clean_env_spec.rb
@@ -3,8 +3,9 @@
RSpec.describe "Bundler.with_env helpers" do
describe "Bundler.original_env" do
before do
+ bundle "config path vendor/bundle"
gemfile ""
- bundle "install --path vendor/bundle"
+ bundle "install"
end
it "should return the PATH present before bundle was activated" do
@@ -55,10 +56,11 @@ RSpec.describe "Bundler.with_env helpers" do
end
end
- describe "Bundler.clean_env" do
+ describe "Bundler.clean_env", :bundler => "< 2" do
before do
+ bundle "config path vendor/bundle"
gemfile ""
- bundle "install --path vendor/bundle"
+ bundle "install"
end
it "should delete BUNDLE_PATH" do
@@ -107,7 +109,7 @@ RSpec.describe "Bundler.with_env helpers" do
end
end
- describe "Bundler.with_clean_env" do
+ describe "Bundler.with_clean_env", :bundler => "< 2" do
it "should set ENV to clean_env in the block" do
expected = Bundler.clean_env
actual = Bundler.with_clean_env { ENV.to_hash }
@@ -123,14 +125,14 @@ RSpec.describe "Bundler.with_env helpers" do
end
end
- describe "Bundler.clean_system", :ruby => ">= 1.9" do
+ describe "Bundler.clean_system", :ruby => ">= 1.9", :bundler => "< 2" do
it "runs system inside with_clean_env" do
Bundler.clean_system(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))
expect($?.exitstatus).to eq(42)
end
end
- describe "Bundler.clean_exec", :ruby => ">= 1.9" do
+ describe "Bundler.clean_exec", :ruby => ">= 1.9", :bundler => "< 2" do
it "runs exec inside with_clean_env" do
pid = Kernel.fork do
Bundler.clean_exec(%(echo 'if [ "$BUNDLE_PATH" = "" ]; then exit 42; else exit 1; fi' | /bin/sh))