diff options
| author | Alyssa Ross | 2017-01-22 19:47:38 +0000 |
|---|---|---|
| committer | GitHub | 2017-01-22 19:47:38 +0000 |
| commit | 6f305ad3dcd01a21b5c5836339338eeb47a239cf (patch) | |
| tree | a1f4856e5b162e898a535589358599e1390fac0c /Library/Homebrew/test/support/helper/test_case.rb | |
| parent | 7c27bfd37accbe3b3779d31d41feb51988fd37d0 (diff) | |
| parent | 6861451f87316ce339af55eaa8e63e5ef8c5021b (diff) | |
| download | brew-6f305ad3dcd01a21b5c5836339338eeb47a239cf.tar.bz2 | |
Merge pull request #1892 from alyssais/global_teardown_fs
tests: clean up file system for all tests
Diffstat (limited to 'Library/Homebrew/test/support/helper/test_case.rb')
| -rw-r--r-- | Library/Homebrew/test/support/helper/test_case.rb | 31 |
1 files changed, 30 insertions, 1 deletions
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 |
