mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fixed test failures with gem command path on ruby core repo.
This commit is contained in:
parent
0fab900538
commit
286cb3395f
Notes:
git
2019-12-15 16:41:37 +09:00
4 changed files with 8 additions and 4 deletions
|
@ -235,7 +235,7 @@ RSpec.describe Bundler::GemHelper do
|
|||
end
|
||||
|
||||
it "uses Kernel.system" do
|
||||
expect(Kernel).to receive(:system).with("gem", "push", app_gem_path.to_s, "--host", "http://example.org").and_return(true)
|
||||
expect(Kernel).to receive(:system).with(gem_bin, "push", app_gem_path.to_s, "--host", "http://example.org").and_return(true)
|
||||
|
||||
Rake.application["release"].invoke
|
||||
end
|
||||
|
|
|
@ -57,7 +57,7 @@ RSpec.describe "bundle exec" do
|
|||
|
||||
it "works when exec'ing to rubygems" do
|
||||
install_gemfile 'gem "rack"'
|
||||
bundle "exec gem --version"
|
||||
bundle "exec #{gem_cmd} --version"
|
||||
expect(out).to eq(Gem::VERSION)
|
||||
end
|
||||
|
||||
|
|
|
@ -21,8 +21,12 @@ module Spec
|
|||
@bindir ||= root.join(ruby_core? ? "libexec" : "exe")
|
||||
end
|
||||
|
||||
def gem_cmd
|
||||
@gem_cmd ||= ruby_core? ? root.join("bin/gem") : "gem"
|
||||
end
|
||||
|
||||
def gem_bin
|
||||
@gem_bin ||= ruby_core? ? ENV["GEM_COMMAND"] : "#{Gem.ruby} -S gem --backtrace"
|
||||
@gem_bin ||= ruby_core? ? ENV["GEM_COMMAND"] : "gem"
|
||||
end
|
||||
|
||||
def spec_dir
|
||||
|
|
|
@ -99,7 +99,7 @@ module Spec
|
|||
no_reqs.map!(&:first)
|
||||
reqs.map! {|name, req| "'#{name}:#{req}'" }
|
||||
deps = reqs.concat(no_reqs).join(" ")
|
||||
gem = Path.gem_bin
|
||||
gem = ENV["GEM_COMMAND"] || "#{Gem.ruby} -S gem --backtrace"
|
||||
cmd = "#{gem} install #{deps} --no-document --conservative"
|
||||
system(cmd) || raise("Installing gems #{deps} for the tests to use failed!")
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue