From fb9818ae8c3cb3bda4182fc1c0fcb6f1e55e4374 Mon Sep 17 00:00:00 2001 From: ilovezfs Date: Tue, 2 Feb 2016 23:37:42 -0800 Subject: [PATCH] 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. --- Library/Homebrew/test/lib/config.rb | 1 + Library/Homebrew/test/test_integration_cmds.rb | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb index 39c4ae27f1..527f2117fa 100644 --- a/Library/Homebrew/test/lib/config.rb +++ b/Library/Homebrew/test/lib/config.rb @@ -1,6 +1,7 @@ require "tmpdir" require "pathname" +HOMEBREW_BREW_FILE = ENV["HOMEBREW_BREW_FILE"] HOMEBREW_TEMP = Pathname.new(ENV["HOMEBREW_TEMP"] || Dir.tmpdir) TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k| diff --git a/Library/Homebrew/test/test_integration_cmds.rb b/Library/Homebrew/test/test_integration_cmds.rb index 78f1ca2781..d2256ee971 100644 --- a/Library/Homebrew/test/test_integration_cmds.rb +++ b/Library/Homebrew/test/test_integration_cmds.rb @@ -7,6 +7,12 @@ require "pathname" class IntegrationCommandTests < Homebrew::TestCase def setup @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 def cmd_id_from_args(args)