From 8b63214c2e7493903f40511a59aba4dd60419349 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Thu, 13 Jul 2017 17:23:24 +0100 Subject: 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). --- .../support/helper/spec/shared_context/integration_test.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb index 94a47acc5..cf9c13fb8 100644 --- a/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb +++ b/Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb @@ -89,8 +89,14 @@ RSpec.shared_context "integration test" do ] if ENV["HOMEBREW_TESTS_COVERAGE"] 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| full_gem_path = spec.full_gem_path # full_require_paths isn't available in RubyGems < 2.2. -- cgit v1.2.3