aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMike McQuaid2015-01-08 20:58:57 +0000
committerMike McQuaid2015-01-09 11:35:03 +0000
commitccd4e5cb4068bc39e1899ef758b8c074da1f7356 (patch)
tree9916b0bdfe7787fdc0dc7a2bc93790c3186fa880 /Library/Homebrew
parent21009001ec3c29fe4936b96a29be00ce1ecff647 (diff)
downloadhomebrew-ccd4e5cb4068bc39e1899ef758b8c074da1f7356.tar.bz2
formula: set HOME to testpath in tests.
Diffstat (limited to 'Library/Homebrew')
-rw-r--r--Library/Homebrew/formula.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 4f1370b10..727eccdab 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -605,13 +605,16 @@ class Formula
end
def run_test
+ @oldhome = ENV["HOME"]
self.build = Tab.for_formula(self)
mktemp do
@testpath = Pathname.pwd
+ ENV["HOME"] = @testpath
test
end
ensure
@testpath = nil
+ ENV["HOME"] = @oldhome
end
def test_defined?