summaryrefslogtreecommitdiff
path: root/spec/commands
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-08-18 00:44:06 +0000
committerBundlerbot <bot@bundler.io>2019-08-18 00:44:06 +0000
commit6125cb3d81908a3505dad8acbe94861176a13b22 (patch)
tree7e8973570c7a6182b1691d8c1d4f9149b93dbd27 /spec/commands
parent64271ffdc2fb06c46d170991151f92687c4857a6 (diff)
parent8ef571ed4e443e066cc17c01de753953ff205c04 (diff)
downloadbundler-6125cb3d81908a3505dad8acbe94861176a13b22.tar.gz
Merge #7274
7274: Fix more leaks to default copy of bundler r=hsbt a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that in some places, it was still possible to end up requiring files in a different copy of bundler (the default copy). I noticed this when I removed a rubygems monkeypatch from the test suite that was preventing the default copy of bundler from being activated when requiring files. This thing: https://github.com/bundler/bundler/blob/e1c518363641208429f397170354054b3d28effd/spec/support/hax.rb#L15-L20 ### What was your diagnosis of the problem? My diagnosis was that I should use relative requires wherever they were missing. ### What is your fix for the problem, implemented in this PR? My fix is to remove the rubygems hack, migrate the rest of the internal requires to be relative, and also introduce some hacks on our specs to make sure we never load the incorrect copy of bundler. I think this PR should fix the issues in https://github.com/rubygems/rubygems/pull/2863. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
Diffstat (limited to 'spec/commands')
-rw-r--r--spec/commands/exec_spec.rb8
-rw-r--r--spec/commands/pristine_spec.rb3
2 files changed, 4 insertions, 7 deletions
diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb
index c68a9c4f43..ec75b9eb0d 100644
--- a/spec/commands/exec_spec.rb
+++ b/spec/commands/exec_spec.rb
@@ -837,14 +837,12 @@ __FILE__: #{path.to_s.inspect}
context "nested bundle exec" do
context "when bundle in a local path" do
before do
- system_gems :bundler
-
gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "rack"
G
- bundle "config path vendor/bundler"
- bundle! :install, :system_bundler => true
+ bundle "config set path vendor/bundler"
+ bundle! :install
end
it "correctly shells out", :ruby_repo do
@@ -854,7 +852,7 @@ __FILE__: #{path.to_s.inspect}
puts `bundle exec echo foo`
RB
file.chmod(0o777)
- bundle! "exec #{file}", :system_bundler => true
+ bundle! "exec #{file}"
expect(out).to eq("foo")
end
end
diff --git a/spec/commands/pristine_spec.rb b/spec/commands/pristine_spec.rb
index 252bef6d0d..aa5c2213d1 100644
--- a/spec/commands/pristine_spec.rb
+++ b/spec/commands/pristine_spec.rb
@@ -42,8 +42,7 @@ RSpec.describe "bundle pristine", :ruby_repo do
expect(changes_txt).to_not be_file
end
- it "does not delete the bundler gem", :rubygems => ">= 2.6.2" do
- ENV["BUNDLER_SPEC_KEEP_DEFAULT_BUNDLER_GEM"] = "true"
+ it "does not delete the bundler gem" do
system_gems :bundler
bundle! "install"
bundle! "pristine", :system_bundler => true