diff options
Diffstat (limited to 'Library/Homebrew/test/support')
| -rw-r--r-- | Library/Homebrew/test/support/helper/spec/shared_context/integration_test.rb | 8 |
1 files changed, 8 insertions, 0 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 fc7b49fa4..2eb98826a 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 @@ -63,7 +63,15 @@ RSpec.shared_context "integration test" do def brew(*args) env = args.last.is_a?(Hash) ? args.pop : {} + # Avoid warnings when HOMEBREW_PREFIX/bin is not in PATH. + path = [ + env["PATH"], + (HOMEBREW_PREFIX/"bin").realpath.to_s, + ENV["PATH"], + ].compact.join(File::PATH_SEPARATOR) + env.merge!( + "PATH" => path, "HOMEBREW_BREW_FILE" => HOMEBREW_PREFIX/"bin/brew", "HOMEBREW_INTEGRATION_TEST" => command_id_from_args(args), "HOMEBREW_TEST_TMPDIR" => TEST_TMPDIR, |
