aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test/support
diff options
context:
space:
mode:
authorAlyssa Ross2017-01-21 15:39:17 +0000
committerAlyssa Ross2017-01-22 11:15:18 +0000
commitd7b8420aaadf93b455a5c268777c3013f8ac2296 (patch)
treec0de9f89716dd30ca3229af26e33036c3a2ca712 /Library/Homebrew/test/support
parent7c27bfd37accbe3b3779d31d41feb51988fd37d0 (diff)
downloadbrew-d7b8420aaadf93b455a5c268777c3013f8ac2296.tar.bz2
tests: clean up file system for all tests
(No longer just integration tests.)
Diffstat (limited to 'Library/Homebrew/test/support')
-rw-r--r--Library/Homebrew/test/support/helper/integration_command_test_case.rb30
-rw-r--r--Library/Homebrew/test/support/helper/test_case.rb31
2 files changed, 30 insertions, 31 deletions
diff --git a/Library/Homebrew/test/support/helper/integration_command_test_case.rb b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
index 86184ac51..a36b56691 100644
--- a/Library/Homebrew/test/support/helper/integration_command_test_case.rb
+++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
@@ -12,36 +12,6 @@ class IntegrationCommandTestCase < Homebrew::TestCase
FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
end
- def teardown
- coretap = CoreTap.new
- paths_to_delete = [
- HOMEBREW_LINKED_KEGS,
- HOMEBREW_PINNED_KEGS,
- HOMEBREW_CELLAR.children,
- HOMEBREW_CACHE.children,
- HOMEBREW_LOCK_DIR.children,
- HOMEBREW_LOGS.children,
- HOMEBREW_TEMP.children,
- HOMEBREW_PREFIX/".git",
- HOMEBREW_PREFIX/"bin",
- HOMEBREW_PREFIX/"share",
- HOMEBREW_PREFIX/"opt",
- HOMEBREW_PREFIX/"Caskroom",
- HOMEBREW_LIBRARY/"Taps/caskroom",
- HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-bundle",
- HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo",
- HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-services",
- HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-shallow",
- HOMEBREW_REPOSITORY/".git",
- coretap.path/".git",
- coretap.alias_dir,
- coretap.formula_dir.children,
- coretap.path/"formula_renames.json",
- ].flatten
- FileUtils.rm_rf paths_to_delete
- super
- end
-
def needs_test_cmd_taps
return if ENV["HOMEBREW_TEST_OFFICIAL_CMD_TAPS"]
skip "HOMEBREW_TEST_OFFICIAL_CMD_TAPS is not set"
diff --git a/Library/Homebrew/test/support/helper/test_case.rb b/Library/Homebrew/test/support/helper/test_case.rb
index ebe5d3d22..53d4e7031 100644
--- a/Library/Homebrew/test/support/helper/test_case.rb
+++ b/Library/Homebrew/test/support/helper/test_case.rb
@@ -20,8 +20,37 @@ module Homebrew
end
def teardown
- Tab.clear_cache
ARGV.replace(@__argv)
+
+ Tab.clear_cache
+
+ coretap = CoreTap.new
+ paths_to_delete = [
+ HOMEBREW_LINKED_KEGS,
+ HOMEBREW_PINNED_KEGS,
+ HOMEBREW_CELLAR.children,
+ HOMEBREW_CACHE.children,
+ HOMEBREW_LOCK_DIR.children,
+ HOMEBREW_LOGS.children,
+ HOMEBREW_TEMP.children,
+ HOMEBREW_PREFIX/".git",
+ HOMEBREW_PREFIX/"bin",
+ HOMEBREW_PREFIX/"share",
+ HOMEBREW_PREFIX/"opt",
+ HOMEBREW_PREFIX/"Caskroom",
+ HOMEBREW_LIBRARY/"Taps/caskroom",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-bundle",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-foo",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-services",
+ HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-shallow",
+ HOMEBREW_REPOSITORY/".git",
+ coretap.path/".git",
+ coretap.alias_dir,
+ coretap.formula_dir.children,
+ coretap.path/"formula_renames.json",
+ ].flatten
+ FileUtils.rm_rf paths_to_delete
+
super
end