summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 17:07:48 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-16 08:43:51 +0200
commit7888d621c85c86d0b0b16b4280a4c4b1b1f8b0ca (patch)
tree0bb7d3616f2ff5e1fc7f93f3edce385d9376d806
parent5379382198eb01f90934ec34845cc26e275f01cd (diff)
downloadbundler-7888d621c85c86d0b0b16b4280a4c4b1b1f8b0ca.tar.gz
Extract single gem installation logic
-rw-r--r--spec/support/helpers.rb10
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