diff options
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 |
