summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/artifice/endpoint.rb2
-rw-r--r--spec/support/hax.rb3
-rw-r--r--spec/support/helpers.rb2
3 files changed, 4 insertions, 3 deletions
diff --git a/spec/support/artifice/endpoint.rb b/spec/support/artifice/endpoint.rb
index 0176059e87..966681f8d8 100644
--- a/spec/support/artifice/endpoint.rb
+++ b/spec/support/artifice/endpoint.rb
@@ -44,7 +44,7 @@ class Endpoint < Sinatra::Base
def dependencies_for(gem_names, gem_repo = GEM_REPO)
return [] if gem_names.nil? || gem_names.empty?
- require "bundler"
+ require "#{Spec::Path.lib}/bundler"
Bundler::Deprecate.skip_during do
all_specs = %w[specs.4.8 prerelease_specs.4.8].map do |filename|
Marshal.load(File.open(gem_repo.join(filename)).read)
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
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index 9cd468dfa1..f069911f65 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -77,7 +77,7 @@ module Spec
def run(cmd, *args)
opts = args.last.is_a?(Hash) ? args.pop : {}
groups = args.map(&:inspect).join(", ")
- setup = "require 'bundler' ; Bundler.setup(#{groups})\n"
+ setup = "require '#{lib}/bundler' ; Bundler.setup(#{groups})\n"
ruby(setup + cmd, opts)
end
bang :run