From 9e021aa661879ed14a39ea1387dedfb94eace177 Mon Sep 17 00:00:00 2001
From: Martin Afanasjew <martin@afanasjew.de>
Date: Sat, 2 Jul 2016 06:15:27 +0200
Subject: [PATCH] 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>
---
 Library/Homebrew/test/lib/config.rb | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/lib/config.rb
index 10c3c8cd75..91ef9fe8af 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"
-- 
GitLab