1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Move environment reset to the only test needing it

https://github.com/bundler/bundler/commit/6d3b809695
This commit is contained in:
David Rodríguez 2019-07-23 08:14:02 +02:00 committed by Hiroshi SHIBATA
parent 6794724548
commit 55831647fb
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 4 additions and 2 deletions

View file

@ -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

View file

@ -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")