aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/test/lib/config.rb8
-rw-r--r--Library/Homebrew/test/testing_env.rb5
2 files changed, 8 insertions, 5 deletions
diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb
index 63b3e0064..86b652660 100644
--- a/Library/Homebrew/test/lib/config.rb
+++ b/Library/Homebrew/test/lib/config.rb
@@ -1,3 +1,11 @@
+require "tmpdir"
+
+TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
+ dir = Dir.mktmpdir("homebrew_tests")
+ at_exit { FileUtils.remove_entry(dir) }
+ ENV[k] = dir
+}
+
HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index 8e907e24a..0e58afeea 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -1,11 +1,6 @@
$:.unshift File.expand_path("../..", __FILE__)
$:.unshift File.expand_path("../lib", __FILE__)
-require "tmpdir"
-
-TEST_TMPDIR = Dir.mktmpdir("homebrew_tests")
-at_exit { FileUtils.remove_entry(TEST_TMPDIR) }
-
require "global"
# Test environment setup