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:
parent
6794724548
commit
55831647fb
2 changed files with 4 additions and 2 deletions
|
@ -54,6 +54,8 @@ RSpec.describe "Bundler.with_env helpers" do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "removes variables that bundler added", :ruby_repo do
|
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")')
|
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")'
|
code = 'puts Bundler.original_env.to_a.map {|e| e.join("=") }.sort.join("\n")'
|
||||||
bundle_exec_ruby! code.dump
|
bundle_exec_ruby! code.dump
|
||||||
|
|
|
@ -78,7 +78,7 @@ RSpec.configure do |config|
|
||||||
config.filter_run_when_matching :focus unless ENV["CI"]
|
config.filter_run_when_matching :focus unless ENV["CI"]
|
||||||
|
|
||||||
original_wd = Dir.pwd
|
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|
|
config.expect_with :rspec do |c|
|
||||||
c.syntax = :expect
|
c.syntax = :expect
|
||||||
|
@ -105,7 +105,7 @@ RSpec.configure do |config|
|
||||||
# Don't wrap output in tests
|
# Don't wrap output in tests
|
||||||
ENV["THOR_COLUMNS"] = "10000"
|
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"]
|
if ENV["BUNDLE_RUBY"]
|
||||||
FileUtils.cp_r Spec::Path.bindir, File.join(Spec::Path.root, "lib", "exe")
|
FileUtils.cp_r Spec::Path.bindir, File.join(Spec::Path.root, "lib", "exe")
|
||||||
|
|
Loading…
Add table
Reference in a new issue