summaryrefslogtreecommitdiff
path: root/spec/bundler/support/matchers.rb
diff options
context:
space:
mode:
authorHiroshi SHIBATA <[email protected]>2021-07-07 14:07:29 +0900
committerHiroshi SHIBATA <[email protected]>2021-07-07 15:31:52 +0900
commitc082c6eb7c786a432bea23cf78839f64585cb630 (patch)
treee3c608264fe03645e905fe7284d713cff87b87dd /spec/bundler/support/matchers.rb
parent6e2240a2f954c84ed12357382c9c065ae4b91e11 (diff)
Sync RubyGems and Bundler with upstream
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4634
Diffstat (limited to 'spec/bundler/support/matchers.rb')
-rw-r--r--spec/bundler/support/matchers.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb
index 3c1014edc7..180ad54c5b 100644
--- a/spec/bundler/support/matchers.rb
+++ b/spec/bundler/support/matchers.rb
@@ -118,14 +118,14 @@ module Spec
opts[:raise_on_error] = false
@errors = names.map do |full_name|
name, version, platform = full_name.split(/\s+/)
- require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/")
+ require_path = name.tr("-", "/")
version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name)
source_const = "#{Spec::Builders.constantize(name)}_SOURCE"
ruby <<~R, opts
- require '#{lib_dir}/bundler'
+ require 'bundler'
Bundler.setup(#{groups})
- require '#{require_path}.rb'
+ require '#{require_path}'
actual_version, actual_platform = #{version_const}.split(/\s+/, 2)
unless Gem::Version.new(actual_version) == Gem::Version.new('#{version}')
puts actual_version
@@ -170,7 +170,7 @@ module Spec
name, version = name.split(/\s+/, 2)
ruby <<-R, opts
begin
- require '#{lib_dir}/bundler'
+ require 'bundler'
Bundler.setup(#{groups})
rescue Bundler::GemNotFound, Bundler::GitError
exit 0