Allow test tmpdir to be passed in

This commit is contained in:
Jack Nagel 2015-04-28 22:37:27 -04:00
parent 0397d68259
commit 44ca2043d0
2 changed files with 8 additions and 5 deletions

View File

@ -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"

View File

@ -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