summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 08:14:02 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-03 09:29:58 +0900
commit55831647fbea0005449f714eec7672fab50cf9d3 (patch)
tree7d6bd84f9b60a4795d4b04e886f5515acb963f33 /spec
parent679472454832f4e9b5c72f282b2933c44ef35ffa (diff)
[bundler/bundler] Move environment reset to the only test needing it
https://github.com/bundler/bundler/commit/6d3b809695
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/runtime/with_unbundled_env_spec.rb2
-rw-r--r--spec/bundler/spec_helper.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/bundler/runtime/with_unbundled_env_spec.rb b/spec/bundler/runtime/with_unbundled_env_spec.rb
index f78cdb5876..b346df6283 100644
--- a/spec/bundler/runtime/with_unbundled_env_spec.rb
+++ b/spec/bundler/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/bundler/spec_helper.rb b/spec/bundler/spec_helper.rb
index 2580187402..e3af0f55d2 100644
--- a/spec/bundler/spec_helper.rb
+++ b/spec/bundler/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")