HOMEBREW_BREW_FILE was unset for the tests

This fixes a regression introduced by 3f6a355, which caused
HOMEBREW_BREW_FILE to be unset while running the tests.

Patch provided by Xu Cheng.
This commit is contained in:
ilovezfs 2016-02-02 23:37:42 -08:00 committed by Xu Cheng
parent 58cf0ec2b9
commit fb9818ae8c
2 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,7 @@
require "tmpdir" require "tmpdir"
require "pathname" require "pathname"
HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"]
HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir) HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir)
TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k| TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|

View File

@ -7,6 +7,12 @@ require "pathname"
class IntegrationCommandTests < Homebrew::TestCase class IntegrationCommandTests < Homebrew::TestCase
def setup def setup
@cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`. @cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`.
(HOMEBREW_PREFIX/"bin").mkpath
FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
end
def teardown
(HOMEBREW_PREFIX/"bin").rmtree
end end
def cmd_id_from_args(args) def cmd_id_from_args(args)