diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-18 13:33:25 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-18 13:33:25 +0000 |
commit | d04963501bc057685220fa1160fb9a102dd46d57 (patch) | |
tree | f01135aaac7519197f6a8992f387176a65283d86 /spec | |
parent | bef0c0a3678d07ce40f147051fba092ee30da640 (diff) | |
download | ruby-d04963501bc057685220fa1160fb9a102dd46d57.tar.gz |
Use ENV["BUNDLE_GEM"] instead of gem command provided by system ruby.
It break the examples of bundler. Because some examples detect the
different version of system ruby than test target version like trunk.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/commands/clean_spec.rb | 14 | ||||
-rw-r--r-- | spec/bundler/support/rubygems_ext.rb | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/spec/bundler/commands/clean_spec.rb b/spec/bundler/commands/clean_spec.rb index 158d58d67c..c18c7a195f 100644 --- a/spec/bundler/commands/clean_spec.rb +++ b/spec/bundler/commands/clean_spec.rb @@ -339,7 +339,8 @@ RSpec.describe "bundle clean" do gem "rack" G - sys_exec! "gem list" + gem = ruby_core? ? ENV["BUNDLE_GEM"] : "gem" + sys_exec! "#{gem} list" expect(out).to include("rack (1.0.0)").and include("thin (1.0)") end @@ -461,8 +462,9 @@ RSpec.describe "bundle clean" do end bundle! :update, :all => bundle_update_requires_all? - sys_exec! "gem list" - expect(out).to include("foo (1.0.1, 1.0)") + gem = ruby_core? ? ENV["BUNDLE_GEM"] : "gem" + sys_exec! "#{gem} list" + expect(out).to include("foo (1.0.1, 1.0)") end it "cleans system gems when --force is used" do @@ -485,7 +487,8 @@ RSpec.describe "bundle clean" do bundle "clean --force" expect(out).to include("Removing foo (1.0)") - sys_exec "gem list" + gem = ruby_core? ? ENV["BUNDLE_GEM"] : "gem" + sys_exec "#{gem} list" expect(out).not_to include("foo (1.0)") expect(out).to include("rack (1.0.0)") end @@ -519,7 +522,8 @@ RSpec.describe "bundle clean" do expect(out).to include(system_gem_path.to_s) expect(out).to include("grant write permissions") - sys_exec "gem list" + gem = ruby_core? ? ENV["BUNDLE_GEM"] : "gem" + sys_exec "#{gem} list" expect(out).to include("foo (1.0)") expect(out).to include("rack (1.0.0)") end diff --git a/spec/bundler/support/rubygems_ext.rb b/spec/bundler/support/rubygems_ext.rb index c18f7650fc..42f887f268 100644 --- a/spec/bundler/support/rubygems_ext.rb +++ b/spec/bundler/support/rubygems_ext.rb @@ -59,10 +59,11 @@ 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" cmd = if Gem::VERSION < "2.0.0" - "gem install #{deps} --no-rdoc --no-ri --conservative" + "#{gem} install #{deps} --no-rdoc --no-ri --conservative" else - "gem install #{deps} --no-document --conservative" + "#{gem} install #{deps} --no-document --conservative" end puts cmd system(cmd) || raise("Installing gems #{deps} for the tests to use failed!") |