summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-15 18:12:34 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-08-17 17:08:50 +0900
commit91c63828f7b841df6b7b124acb752c0a3bca66c0 (patch)
treeccdf30b6e7500357ffd152d39817261666412b68 /spec
parente38994d2f70ac714f749f69833fce5c5e8461513 (diff)
downloadruby-91c63828f7b841df6b7b124acb752c0a3bca66c0.tar.gz
[bundler/bundler] Extract a `gem_bin` path helper
https://github.com/bundler/bundler/commit/8eedbecac0
Diffstat (limited to 'spec')
-rw-r--r--spec/bundler/support/path.rb4
-rw-r--r--spec/bundler/support/rubygems_ext.rb2
2 files changed, 5 insertions, 1 deletions
diff --git a/spec/bundler/support/path.rb b/spec/bundler/support/path.rb
index 302d79dc46..80616ce546 100644
--- a/spec/bundler/support/path.rb
+++ b/spec/bundler/support/path.rb
@@ -17,6 +17,10 @@ module Spec
@bindir ||= root.join(ruby_core? ? "libexec" : "exe")
end
+ def gem_bin
+ @gem_bin ||= ruby_core? ? ENV["BUNDLE_GEM"] : "#{Gem.ruby} -S gem"
+ end
+
def spec_dir
@spec_dir ||= root.join(ruby_core? ? "spec/bundler" : "spec")
end
diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb
index 6ca51bee16..21916bd17d 100644
--- a/spec/bundler/support/rubygems_ext.rb
+++ b/spec/bundler/support/rubygems_ext.rb
@@ -81,7 +81,7 @@ module Spec
no_reqs.map!(&:first)
reqs.map! {|name, req| "'#{name}:#{req}'" }
deps = reqs.concat(no_reqs).join(" ")
- gem = Spec::Path.ruby_core? ? ENV["BUNDLE_GEM"] : "#{Gem.ruby} -S gem"
+ gem = Spec::Path.gem_bin
cmd = "#{gem} install #{deps} --no-document --conservative"
puts cmd
system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")