summaryrefslogtreecommitdiff
path: root/spec/support/hax.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-23 18:44:21 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-08-17 13:39:39 +0200
commitac655ffeda6433ce16f0013801c19ec361ce20a2 (patch)
treead832c359aa6b8595d222bbdcf2334f99784a75c /spec/support/hax.rb
parenta3d72a34aba89df3951fc629096b66b73bc56f95 (diff)
downloadbundler-ac655ffeda6433ce16f0013801c19ec361ce20a2.tar.gz
Remove unnecessary rubygems monkeypatch
Instead, make sure we always load the local copy of bundler during specs, and never end up using the default copy.
Diffstat (limited to 'spec/support/hax.rb')
-rw-r--r--spec/support/hax.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/support/hax.rb b/spec/support/hax.rb
index 5e6acdc783..c8f78a34a1 100644
--- a/spec/support/hax.rb
+++ b/spec/support/hax.rb
@@ -11,7 +11,8 @@ module Gem
end
@platforms = [Gem::Platform::RUBY, Gem::Platform.local]
- if defined?(@path_to_default_spec_map) && !ENV["BUNDLER_SPEC_KEEP_DEFAULT_BUNDLER_GEM"]
+ # We only need this hack for rubygems versions without the BundlerVersionFinder
+ if Gem::Version.new(Gem::VERSION) < Gem::Version.new("2.7.0") || ENV["BUNDLER_SPEC_DISABLE_DEFAULT_BUNDLER_GEM"]
@path_to_default_spec_map.delete_if do |_path, spec|
spec.name == "bundler"
end