From ec0f2187a24fcbed41ee58719e0928dfe9155bba Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 25 Feb 2017 09:01:24 +0100 Subject: Avoid warnings when HOMEBREW_PREFIX/bin is not in PATH. --- .../test/support/helper/spec/shared_context/integration_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Library/Homebrew/test/support') 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, -- cgit v1.2.3