integration_test: try tests on Gem load failure.

This should help with debugging `Gem::LoadError`s (e.g. for
https://github.com/Homebrew/homebrew-test-bot/pull/111).
This commit is contained in:
Mike McQuaid 2017-07-13 17:23:24 +01:00
parent 7c26dfee55
commit 8b63214c2e

View File

@ -89,8 +89,14 @@ RSpec.shared_context "integration test" do
] ]
if ENV["HOMEBREW_TESTS_COVERAGE"] if ENV["HOMEBREW_TESTS_COVERAGE"]
simplecov_spec = Gem.loaded_specs["simplecov"] simplecov_spec = Gem.loaded_specs["simplecov"]
specs = simplecov_spec.runtime_dependencies.flat_map(&:to_specs) specs = [simplecov_spec]
specs << simplecov_spec simplecov_spec.runtime_dependencies.each do |dep|
begin
specs += dep.to_specs
rescue Gem::LoadError => e
onoe e
end
end
libs = specs.flat_map do |spec| libs = specs.flat_map do |spec|
full_gem_path = spec.full_gem_path full_gem_path = spec.full_gem_path
# full_require_paths isn't available in RubyGems < 2.2. # full_require_paths isn't available in RubyGems < 2.2.