Skip to content

Commit

Permalink
Use with_unbundled_env in specs aswell
Browse files Browse the repository at this point in the history
  • Loading branch information
randome committed Jun 27, 2020
1 parent 86d6c16 commit a1dfc78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion spec/bump_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ module Foo
gemspec
RUBY
`git add Gemfile #{gemspec}`
Bundler.with_clean_env { run("bundle") }
bundler_with_clean_env { run("bundle") }
`git add Gemfile.lock`
end

Expand Down Expand Up @@ -708,4 +708,12 @@ def with_file(file, content)
ensure
File.unlink file
end

def bundler_with_clean_env(&block)
if Bundler.respond_to?(:with_unbundled_env)
Bundler.with_unbundled_env(&block)
else
Bundler.with_clean_env(&block)
end
end
end

0 comments on commit a1dfc78

Please sign in to comment.