mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
Use Bundler.with_clean_env
Use Bundler.with_clean_env for cleaner behaviour when performing actions for different test Gemfiles, mainly installing dependencies. Previously, running e.g. `bundle exec rake test:rc` could resuly in errors as the parent Bundler environment was fully removed.
This commit is contained in:
parent
908fad0dc4
commit
b09bf0a900
1 changed files with 5 additions and 6 deletions
11
Rakefile
11
Rakefile
|
@ -108,14 +108,13 @@ def gemfiles
|
|||
end
|
||||
|
||||
def with_each_gemfile
|
||||
old_env = ENV['BUNDLE_GEMFILE']
|
||||
gemfiles.each do |gemfile|
|
||||
puts "Using gemfile: #{gemfile}"
|
||||
ENV['BUNDLE_GEMFILE'] = gemfile
|
||||
yield
|
||||
Bundler.with_clean_env do
|
||||
puts "Using gemfile: #{gemfile}"
|
||||
ENV['BUNDLE_GEMFILE'] = gemfile
|
||||
yield
|
||||
end
|
||||
end
|
||||
ensure
|
||||
ENV['BUNDLE_GEMFILE'] = old_env
|
||||
end
|
||||
|
||||
namespace :test do
|
||||
|
|
Loading…
Add table
Reference in a new issue