diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-15 21:31:12 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-05-22 20:32:30 +0900 |
commit | c7ebeb7eda9f7f6bbb48effe1efc026eeb64d09c (patch) | |
tree | b516b3b5119331d4d8431b4d17f552e2c8e798fe /spec/bundler/support/matchers.rb | |
parent | f4f157fc81b940c0f76a01ee266a08e6bba69b6b (diff) |
Sync Bundler PR #3624
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3114
Diffstat (limited to 'spec/bundler/support/matchers.rb')
-rw-r--r-- | spec/bundler/support/matchers.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/bundler/support/matchers.rb b/spec/bundler/support/matchers.rb index e6275064a8..a5e546d333 100644 --- a/spec/bundler/support/matchers.rb +++ b/spec/bundler/support/matchers.rb @@ -115,13 +115,18 @@ module Spec opts = names.last.is_a?(Hash) ? names.pop : {} source = opts.delete(:source) groups = Array(opts[:groups]) + exclude_from_load_path = opts.delete(:exclude_from_load_path) groups << opts @errors = names.map do |name| name, version, platform = name.split(/\s+/) require_path = name == "bundler" ? "#{lib_dir}/bundler" : name.tr("-", "/") version_const = name == "bundler" ? "Bundler::VERSION" : Spec::Builders.constantize(name) begin - run! "require '#{require_path}.rb'; puts #{version_const}", *groups + code = [] + code << "$LOAD_PATH.delete '#{exclude_from_load_path}'" if exclude_from_load_path + code << "require '#{require_path}.rb'" + code << "puts #{version_const}" + run! code.join("; "), *groups rescue StandardError => e next "#{name} is not installed:\n#{indent(e)}" end |