diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-15 17:07:48 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-08-16 08:43:51 +0200 |
commit | 7888d621c85c86d0b0b16b4280a4c4b1b1f8b0ca (patch) | |
tree | 0bb7d3616f2ff5e1fc7f93f3edce385d9376d806 | |
parent | 5379382198eb01f90934ec34845cc26e275f01cd (diff) | |
download | bundler-7888d621c85c86d0b0b16b4280a4c4b1b1f8b0ca.tar.gz |
Extract single gem installation logic
-rw-r--r-- | spec/support/helpers.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb index 4a0a07244c..a46292665b 100644 --- a/spec/support/helpers.rb +++ b/spec/support/helpers.rb @@ -314,14 +314,18 @@ module Spec "#{gem_repo}/gems/#{g}.gem" end - raise "OMG `#{path}` does not exist!" unless File.exist?(path) - - gem_command! :install, "--no-document --ignore-dependencies '#{path}'" + install_gem(path) bundler_path && bundler_path.rmtree end end + def install_gem(path) + raise "OMG `#{path}` does not exist!" unless File.exist?(path) + + gem_command! :install, "--no-document --ignore-dependencies '#{path}'" + end + def with_gem_path_as(path) backup = ENV.to_hash ENV["GEM_HOME"] = path.to_s |