diff options
| author | Markus Reiter | 2017-02-25 09:01:24 +0100 |
|---|---|---|
| committer | Markus Reiter | 2017-02-25 09:08:05 +0100 |
| commit | ec0f2187a24fcbed41ee58719e0928dfe9155bba (patch) | |
| tree | 55fc0cf3ab9772c77274973436982b0815f351df /Library/Homebrew/test/support/helper | |
| parent | a2b4ee1ecd9ac5c91f9b5b3a6710f926cc237d15 (diff) | |
| download | brew-ec0f2187a24fcbed41ee58719e0928dfe9155bba.tar.bz2 | |
Avoid warnings when HOMEBREW_PREFIX/bin is not in PATH.
Diffstat (limited to 'Library/Homebrew/test/support/helper')
| -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, |
