summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 08:14:02 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 11:23:00 +0200
commit6d3b809695e579f0b64f111e023f47721cad3f30 (patch)
tree34df9557a710dc0bf975557a7e2c6dd3105ce0f4
parenta82ad111e5bcd1db2b331cceed0330f453912e61 (diff)
downloadbundler-6d3b809695e579f0b64f111e023f47721cad3f30.tar.gz
Move environment reset to the only test needing it
-rw-r--r--spec/runtime/with_unbundled_env_spec.rb2
-rw-r--r--spec/spec_helper.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/runtime/with_unbundled_env_spec.rb b/spec/runtime/with_unbundled_env_spec.rb
index f78cdb5876..b346df6283 100644
--- a/spec/runtime/with_unbundled_env_spec.rb
+++ b/spec/runtime/with_unbundled_env_spec.rb
@@ -54,6 +54,8 @@ RSpec.describe "Bundler.with_env helpers" do
end
it "removes variables that bundler added", :ruby_repo do
+ ENV.replace(ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) })
+
original = ruby!('puts ENV.to_a.map {|e| e.join("=") }.sort.join("\n")')
code = 'puts Bundler.original_env.to_a.map {|e| e.join("=") }.sort.join("\n")'
bundle_exec_ruby! code.dump
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 2580187402..e3af0f55d2 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -78,7 +78,7 @@ RSpec.configure do |config|
config.filter_run_when_matching :focus unless ENV["CI"]
original_wd = Dir.pwd
- original_env = ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) }
+ original_env = ENV.to_hash
config.expect_with :rspec do |c|
c.syntax = :expect
@@ -105,7 +105,7 @@ RSpec.configure do |config|
# Don't wrap output in tests
ENV["THOR_COLUMNS"] = "10000"
- original_env = ENV.to_hash.delete_if {|k, _v| k.start_with?(Bundler::EnvironmentPreserver::BUNDLER_PREFIX) }
+ original_env = ENV.to_hash
if ENV["BUNDLE_RUBY"]
FileUtils.cp_r Spec::Path.bindir, File.join(Spec::Path.root, "lib", "exe")