aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBaptiste Fontaine2016-01-04 23:14:51 +0100
committerBaptiste Fontaine2016-01-05 14:33:06 +0100
commit5d8a6e368f2c8fd5d2075cfb9dd8bb3928c2ac42 (patch)
tree013903042d2894a6bba6d3e51e3308e225ed379e /Library
parentd99cfd139424b12f662eecba28acb05994865aa0 (diff)
downloadbrew-5d8a6e368f2c8fd5d2075cfb9dd8bb3928c2ac42.tar.bz2
integration tests: allow env overriding
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/test_integration_cmds.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb
index dab987b1f..41cc9ac05 100644
--- a/Library/Homebrew/test/test_integration_cmds.rb
+++ b/Library/Homebrew/test/test_integration_cmds.rb
@@ -4,6 +4,8 @@ require "core_formula_repository"
class IntegrationCommandTests < Homebrew::TestCase
def cmd_output(*args)
+ # 1.8-compatible way of writing def cmd_output(*args, **env)
+ env = args.last.is_a?(Hash) ? args.pop : {}
cmd_args = %W[
-W0
-I#{HOMEBREW_LIBRARY_PATH}/test/lib
@@ -16,6 +18,8 @@ class IntegrationCommandTests < Homebrew::TestCase
ENV["HOMEBREW_BREW_FILE"] = HOMEBREW_PREFIX/"bin/brew"
ENV["HOMEBREW_INTEGRATION_TEST"] = args.join " "
ENV["HOMEBREW_TEST_TMPDIR"] = TEST_TMPDIR
+ env.each_pair { |k,v| ENV[k] = v }
+
read, write = IO.pipe
begin
pid = fork do