aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/support
diff options
context:
space:
mode:
authorAlyssa Ross2017-01-21 14:57:44 +0000
committerAlyssa Ross2017-01-22 19:53:58 +0000
commit116ed3ec80b6d1b9d6178f25793cfcaaaa161308 (patch)
tree5ba702bfb1da06de3adf717f867537f667bacb52 /Library/Homebrew/test/support
parent6e0f1366b014b285799c9bb9c311c6345bcd666b (diff)
downloadbrew-116ed3ec80b6d1b9d6178f25793cfcaaaa161308.tar.bz2
tests: automatically restore ENV in teardown
Diffstat (limited to 'Library/Homebrew/test/support')
-rw-r--r--Library/Homebrew/test/support/helper/test_case.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/Library/Homebrew/test/support/helper/test_case.rb b/Library/Homebrew/test/support/helper/test_case.rb
index 53d4e7031..c4c7f8727 100644
--- a/Library/Homebrew/test/support/helper/test_case.rb
+++ b/Library/Homebrew/test/support/helper/test_case.rb
@@ -16,11 +16,14 @@ module Homebrew
def setup
super
+
@__argv = ARGV.dup
+ @__env = copy_env # Call #to_hash to duplicate ENV
end
def teardown
ARGV.replace(@__argv)
+ restore_env @__env
Tab.clear_cache