summaryrefslogtreecommitdiff
path: root/spec/bundler
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 17:07:48 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:08:51 +0900
commitaef5509139abd34f9983fa00895f91ea2801f088 (patch)
treeafdb051ba5fa4f197648189853366b57bcf5f493 /spec/bundler
parent20af44c27727333b4cd3eef9d5b18daaa0445f0e (diff)
[bundler/bundler] Extract single gem installation logic
https://github.com/bundler/bundler/commit/7888d621c8
Diffstat (limited to 'spec/bundler')
-rw-r--r--spec/bundler/support/helpers.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/spec/bundler/support/helpers.rb b/spec/bundler/support/helpers.rb
index 4a0a07244c..a46292665b 100644
--- a/spec/bundler/support/helpers.rb
+++ b/spec/bundler/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