diff options
| author | Mike McQuaid | 2017-07-13 17:23:24 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2017-07-13 17:25:34 +0100 |
| commit | 8b63214c2e7493903f40511a59aba4dd60419349 (patch) | |
| tree | 5e58831037e3bd1aa7171a5c90edb6ac4519d395 | |
| parent | 7c26dfee555c178ede4341514368da52233db244 (diff) | |
| download | brew-8b63214c2e7493903f40511a59aba4dd60419349.tar.bz2 | |
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).
| -rw-r--r-- | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | 10 |
1 files changed, 8 insertions, 2 deletions
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. |
