diff options
author | Hiroshi SHIBATA <[email protected]> | 2020-05-21 21:05:07 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2020-05-22 20:32:30 +0900 |
commit | 1d889c96562e9619d2cab443da711e82daeb983c (patch) | |
tree | 0a6a142360be987ceaff6cbf24a03fd5797ecb66 /spec/bundler/runtime/gem_tasks_spec.rb | |
parent | 93ebf9643dc0913693157e6b4bb391a549a9b8ae (diff) |
Sync Bundler PR #3624 with HEAD commits
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3114
Diffstat (limited to 'spec/bundler/runtime/gem_tasks_spec.rb')
-rw-r--r-- | spec/bundler/runtime/gem_tasks_spec.rb | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/spec/bundler/runtime/gem_tasks_spec.rb b/spec/bundler/runtime/gem_tasks_spec.rb index 9d673bb9cc..a81eaf5468 100644 --- a/spec/bundler/runtime/gem_tasks_spec.rb +++ b/spec/bundler/runtime/gem_tasks_spec.rb @@ -15,7 +15,6 @@ RSpec.describe "require 'bundler/gem_tasks'" do bundled_app("Rakefile").open("w") do |f| f.write <<-RAKEFILE - $:.unshift("#{lib_dir}") require "bundler/gem_tasks" RAKEFILE end @@ -28,8 +27,8 @@ RSpec.describe "require 'bundler/gem_tasks'" do end it "includes the relevant tasks" do - with_gem_path_as(Spec::Path.base_system_gems.to_s) do - sys_exec "#{rake} -T", :env => { "RUBYOPT" => opt_add("-I#{lib_dir}", ENV["RUBYOPT"]) } + with_gem_path_as(base_system_gems.to_s) do + sys_exec "#{rake} -T", :env => { "GEM_HOME" => system_gem_path.to_s } end expect(err).to be_empty @@ -46,8 +45,8 @@ RSpec.describe "require 'bundler/gem_tasks'" do end it "defines a working `rake install` task" do - with_gem_path_as(Spec::Path.base_system_gems.to_s) do - sys_exec "#{rake} install", :env => { "RUBYOPT" => opt_add("-I#{lib_dir}", ENV["RUBYOPT"]) } + with_gem_path_as(base_system_gems.to_s) do + sys_exec "#{rake} install", :env => { "GEM_HOME" => system_gem_path.to_s } end expect(err).to be_empty @@ -69,9 +68,27 @@ RSpec.describe "require 'bundler/gem_tasks'" do end end + context "bundle path configured locally" do + before do + bundle "config set path vendor/bundle" + end + + it "works" do + install_gemfile! <<-G + source "#{file_uri_for(gem_repo1)}" + + gem "rake" + G + + bundle! "exec rake -T" + + expect(err).to be_empty + end + end + it "adds 'pkg' to rake/clean's CLOBBER" do - with_gem_path_as(Spec::Path.base_system_gems.to_s) do - sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect') + with_gem_path_as(base_system_gems.to_s) do + sys_exec! %(#{rake} -e 'load "Rakefile"; puts CLOBBER.inspect'), :env => { "GEM_HOME" => system_gem_path.to_s } end expect(out).to eq '["pkg"]' end |