aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Afanasjew2016-07-02 06:15:27 +0200
committerMartin Afanasjew2016-07-05 20:09:07 +0200
commit9e021aa661879ed14a39ea1387dedfb94eace177 (patch)
treed3f65fc9afe4f99195bf7f63360cac34643b9131
parent22a47af1a20b2190742a7f5a79a83143a4fcfa84 (diff)
downloadbrew-9e021aa661879ed14a39ea1387dedfb94eace177.tar.bz2
test/lib/config: group paths by persistence
Rearrange path constants such that persistent paths (that point into the Homebrew code base) are in one spot and all other paths (that are being redirected to a temporary location for the duration of the test run) are grouped together. Closes #440. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
-rw-r--r--Library/Homebrew/test/lib/config.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb
index 10c3c8cd7..91ef9fe8a 100644
--- a/Library/Homebrew/test/lib/config.rb
+++ b/Library/Homebrew/test/lib/config.rb
@@ -10,12 +10,15 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") { |k|
ENV[k] = dir
}
-HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
-HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
-HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
+# Paths pointing into the Homebrew code base that persist across test runs
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __FILE__))
HOMEBREW_ENV_PATH = HOMEBREW_LIBRARY_PATH.parent+"ENV"
HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
+
+# Paths redirected to a temporary directory and wiped at the end of the test run
+HOMEBREW_PREFIX = Pathname.new(TEST_TMPDIR).join("prefix")
+HOMEBREW_REPOSITORY = HOMEBREW_PREFIX
+HOMEBREW_LIBRARY = HOMEBREW_REPOSITORY+"Library"
HOMEBREW_CACHE = HOMEBREW_PREFIX.parent+"cache"
HOMEBREW_CACHE_FORMULA = HOMEBREW_PREFIX.parent+"formula_cache"
HOMEBREW_LOCK_DIR = HOMEBREW_PREFIX.parent+"locks"