From 4db1317f38f5a55574854e7bf1dfe4379e807b4f Mon Sep 17 00:00:00 2001
From: Markus Reiter <me@reitermark.us>
Date: Mon, 24 Oct 2016 22:53:25 +0200
Subject: [PATCH] Move all remaining fixtures to `test/support/fixtures`.

---
 Library/Homebrew/cask/spec/spec_helper.rb      |   6 +++---
 Library/Homebrew/cask/test/test_helper.rb      |   6 +++---
 ...estball_bottle-0.1.el_capitan.bottle.tar.gz |   0
 ...tball_bottle-0.1.linux_x86_64.bottle.tar.gz |   0
 ...ll_bottle-0.1.macintosh_intel.bottle.tar.gz |   0
 ...testball_bottle-0.1.mavericks.bottle.tar.gz |   0
 ...ball_bottle-0.1.mountain_lion.bottle.tar.gz |   0
 .../testball_bottle-0.1.sierra.bottle.tar.gz   |   0
 .../testball_bottle-0.1.yosemite.bottle.tar.gz | Bin
 .../fixtures/cask/AppWithBinary.zip            | Bin
 .../fixtures/cask/AppWithEmbeddedBinary.zip    | Bin
 .../{ => support}/fixtures/cask/MyFancyApp.zip | Bin
 .../{ => support}/fixtures/cask/MyFancyPkg.zip | Bin
 .../fixtures/cask/NestedApp.dmg.zip            | Bin
 .../fixtures/cask/caffeine-suite.zip           | Bin
 .../{ => support}/fixtures/cask/caffeine.zip   | Bin
 .../fixtures/cask/caffeines-subdir.zip         | Bin
 .../{ => support}/fixtures/cask/caffeines.zip  | Bin
 .../{ => support}/fixtures/cask/container.7z   | Bin
 .../{ => support}/fixtures/cask/container.air  | Bin
 .../{ => support}/fixtures/cask/container.bz2  | Bin
 .../{ => support}/fixtures/cask/container.cab  | Bin
 .../{ => support}/fixtures/cask/container.dmg  | Bin
 .../{ => support}/fixtures/cask/container.gz   | Bin
 .../{ => support}/fixtures/cask/container.lzma | Bin
 .../{ => support}/fixtures/cask/container.pkg  | Bin
 .../{ => support}/fixtures/cask/container.rar  | Bin
 .../{ => support}/fixtures/cask/container.sit  | Bin
 .../fixtures/cask/container.tar.gz             | Bin
 .../{ => support}/fixtures/cask/container.xar  | Bin
 .../{ => support}/fixtures/cask/container.xz   | Bin
 .../fixtures/cask/empty_directory/.gitignore   |   0
 .../fixtures/cask/naked_executable             |   0
 .../fixtures/cask/transmission-2.61.dmg        | Bin
 .../test/{ => support/fixtures}/mach/a.out     | Bin
 .../{ => support/fixtures}/mach/fat.bundle     | Bin
 .../test/{ => support/fixtures}/mach/fat.dylib | Bin
 .../{ => support/fixtures}/mach/i386.bundle    | Bin
 .../{ => support/fixtures}/mach/i386.dylib     | Bin
 .../{ => support/fixtures}/mach/x86_64.bundle  | Bin
 .../{ => support/fixtures}/mach/x86_64.dylib   | Bin
 .../{ => support/fixtures}/patches/noop-a.diff |   0
 .../{ => support/fixtures}/patches/noop-b.diff |   0
 .../{ => support/fixtures}/patches/noop-c.diff |   0
 .../test/{ => support}/fixtures/receipt.json   |   0
 .../{ => support}/fixtures/receipt_old.json    |   0
 .../tarballs/testball-0.1-patches.tgz          | Bin
 .../fixtures}/tarballs/testball-0.1.tbz        | Bin
 .../fixtures}/tarballs/testbottest-0.1.tbz     | Bin
 .../test/{ => support}/fixtures/test.diff      |   0
 .../test/{ => support}/fixtures/test.eps       |   0
 .../test/{ => support}/fixtures/test.gif       | Bin
 .../test/{ => support}/fixtures/test.ico       | Bin
 .../test/{ => support}/fixtures/test.jpg       | Bin
 .../test/{ => support}/fixtures/test.m4a       | Bin
 .../test/{ => support}/fixtures/test.mp3       | Bin
 .../test/{ => support}/fixtures/test.pcap      | Bin
 .../test/{ => support}/fixtures/test.pdf       |   0
 .../test/{ => support}/fixtures/test.png       | Bin
 .../test/{ => support}/fixtures/test.ps        |   0
 .../test/{ => support}/fixtures/test.svg       |   0
 .../test/{ => support}/fixtures/test.tiff      | Bin
 .../test/{ => support}/fixtures/test.wav       | Bin
 .../test/{ => support/fixtures}/testball.rb    |   2 +-
 .../{ => support/fixtures}/testball_bottle.rb  |   4 ++--
 .../test/{ => support/fixtures}/testbottest.rb |   2 +-
 .../fixtures/updater_fixture.yaml              |   0
 .../Homebrew/test/{ => support}/helper/env.rb  |   0
 .../helper/integration_command_test_case.rb    |   8 ++++----
 .../test/{ => support}/helper/shutup.rb        |   0
 .../Homebrew/test/{ => support}/lib/config.rb  |   4 ++--
 .../{ => support}/lib/integration_mocks.rb     |   0
 Library/Homebrew/test/test/ENV_test.rb         |   3 ++-
 Library/Homebrew/test/test/analytics_test.rb   |   3 ++-
 Library/Homebrew/test/test/bottle_test.rb      |   3 ++-
 Library/Homebrew/test/test/bundle_test.rb      |   3 ++-
 .../Homebrew/test/test/cache_formula_test.rb   |   3 ++-
 Library/Homebrew/test/test/cache_test.rb       |   3 ++-
 Library/Homebrew/test/test/cask_test.rb        |   3 ++-
 Library/Homebrew/test/test/cat_test.rb         |   3 ++-
 .../Homebrew/test/test/cellar_formula_test.rb  |   3 ++-
 Library/Homebrew/test/test/cellar_test.rb      |   3 ++-
 .../test/test/checksum_verification_test.rb    |   2 +-
 Library/Homebrew/test/test/cleaner_test.rb     |   4 ++--
 Library/Homebrew/test/test/cleanup_test.rb     |   5 +++--
 Library/Homebrew/test/test/command_test.rb     |   3 ++-
 Library/Homebrew/test/test/commands_test.rb    |   3 ++-
 Library/Homebrew/test/test/config_test.rb      |   3 ++-
 Library/Homebrew/test/test/create_test.rb      |   5 +++--
 .../Homebrew/test/test/custom_command_test.rb  |   3 ++-
 Library/Homebrew/test/test/deps_test.rb        |   3 ++-
 Library/Homebrew/test/test/desc_test.rb        |   3 ++-
 Library/Homebrew/test/test/doctor_test.rb      |   3 ++-
 Library/Homebrew/test/test/edit_test.rb        |   3 ++-
 Library/Homebrew/test/test/fetch_test.rb       |   3 ++-
 .../test/test/formula_installer_bottle_test.rb |   4 ++--
 .../test/test/formula_installer_test.rb        |   4 ++--
 Library/Homebrew/test/test/formula_test.rb     |   2 +-
 Library/Homebrew/test/test/formulary_test.rb   |   4 ++--
 Library/Homebrew/test/test/help_test.rb        |   3 ++-
 Library/Homebrew/test/test/home_test.rb        |   3 ++-
 Library/Homebrew/test/test/info_test.rb        |   3 ++-
 Library/Homebrew/test/test/install_test.rb     |   3 ++-
 Library/Homebrew/test/test/irb_test.rb         |   3 ++-
 Library/Homebrew/test/test/leaves_test.rb      |   3 ++-
 Library/Homebrew/test/test/link_test.rb        |   3 ++-
 Library/Homebrew/test/test/linkapps_test.rb    |   3 ++-
 Library/Homebrew/test/test/list_test.rb        |   3 ++-
 Library/Homebrew/test/test/log_formula_test.rb |   3 ++-
 Library/Homebrew/test/test/log_test.rb         |   3 ++-
 Library/Homebrew/test/test/migrate_test.rb     |   3 ++-
 Library/Homebrew/test/test/migrator_test.rb    |   2 +-
 Library/Homebrew/test/test/missing_test.rb     |   3 ++-
 Library/Homebrew/test/test/options_test.rb     |   3 ++-
 Library/Homebrew/test/test/os/mac/mach_test.rb |   4 ++--
 Library/Homebrew/test/test/outdated_test.rb    |   3 ++-
 Library/Homebrew/test/test/patching_test.rb    |  12 ++++++------
 Library/Homebrew/test/test/pin_unpin_test.rb   |   3 ++-
 .../Homebrew/test/test/prefix_formula_test.rb  |   3 ++-
 Library/Homebrew/test/test/prefix_test.rb      |   3 ++-
 Library/Homebrew/test/test/prune_test.rb       |   3 ++-
 .../Homebrew/test/test/pull_offline_test.rb    |   3 ++-
 Library/Homebrew/test/test/pull_test.rb        |   3 ++-
 Library/Homebrew/test/test/readall_test.rb     |   3 ++-
 .../test/test/reinstall_pinned_test.rb         |   3 ++-
 Library/Homebrew/test/test/reinstall_test.rb   |   3 ++-
 Library/Homebrew/test/test/repository_test.rb  |   3 ++-
 Library/Homebrew/test/test/search_test.rb      |   3 ++-
 Library/Homebrew/test/test/services_test.rb    |   3 ++-
 Library/Homebrew/test/test/sh_test.rb          |   3 ++-
 Library/Homebrew/test/test/switch_test.rb      |   3 ++-
 Library/Homebrew/test/test/tab_test.rb         |   2 +-
 Library/Homebrew/test/test/tap_new_test.rb     |   3 ++-
 Library/Homebrew/test/test/tap_test.rb         |   3 ++-
 .../Homebrew/test/test/test_formula_test.rb    |   5 +++--
 Library/Homebrew/test/test/uninstall_test.rb   |   2 +-
 Library/Homebrew/test/test/unlink_test.rb      |   3 ++-
 Library/Homebrew/test/test/unlinkapps_test.rb  |   3 ++-
 Library/Homebrew/test/test/unpack_test.rb      |   3 ++-
 Library/Homebrew/test/test/upgrade_test.rb     |   3 ++-
 Library/Homebrew/test/test/uses_test.rb        |   3 ++-
 Library/Homebrew/test/test/version_test.rb     |   3 ++-
 Library/Homebrew/test/testing_env.rb           |  17 ++++++++---------
 143 files changed, 166 insertions(+), 108 deletions(-)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.sierra.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/AppWithBinary.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/AppWithEmbeddedBinary.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/MyFancyApp.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/MyFancyPkg.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/NestedApp.dmg.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/caffeine-suite.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/caffeine.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/caffeines-subdir.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/caffeines.zip (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.7z (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.air (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.bz2 (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.cab (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.dmg (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.gz (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.lzma (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.pkg (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.rar (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.sit (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.tar.gz (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.xar (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/container.xz (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/empty_directory/.gitignore (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/naked_executable (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/cask/transmission-2.61.dmg (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/a.out (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/fat.bundle (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/fat.dylib (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/i386.bundle (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/i386.dylib (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/x86_64.bundle (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/mach/x86_64.dylib (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/patches/noop-a.diff (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/patches/noop-b.diff (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/patches/noop-c.diff (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/receipt.json (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/receipt_old.json (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/tarballs/testball-0.1-patches.tgz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/tarballs/testball-0.1.tbz (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/tarballs/testbottest-0.1.tbz (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.diff (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.eps (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.gif (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.ico (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.jpg (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.m4a (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.mp3 (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.pcap (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.pdf (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.png (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.ps (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.svg (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.tiff (100%)
 rename Library/Homebrew/test/{ => support}/fixtures/test.wav (100%)
 rename Library/Homebrew/test/{ => support/fixtures}/testball.rb (78%)
 rename Library/Homebrew/test/{ => support/fixtures}/testball_bottle.rb (76%)
 rename Library/Homebrew/test/{ => support/fixtures}/testbottest.rb (82%)
 rename Library/Homebrew/test/{ => support}/fixtures/updater_fixture.yaml (100%)
 rename Library/Homebrew/test/{ => support}/helper/env.rb (100%)
 rename Library/Homebrew/test/{ => support}/helper/integration_command_test_case.rb (96%)
 rename Library/Homebrew/test/{ => support}/helper/shutup.rb (100%)
 rename Library/Homebrew/test/{ => support}/lib/config.rb (95%)
 rename Library/Homebrew/test/{ => support}/lib/integration_mocks.rb (100%)

diff --git a/Library/Homebrew/cask/spec/spec_helper.rb b/Library/Homebrew/cask/spec/spec_helper.rb
index 7e72a2cee5..458fe00f4f 100644
--- a/Library/Homebrew/cask/spec/spec_helper.rb
+++ b/Library/Homebrew/cask/spec/spec_helper.rb
@@ -8,15 +8,15 @@ end
 
 # add Homebrew to load path
 $LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
-$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
+$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
 
 require "global"
 
 # add Homebrew-Cask to load path
 $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
 
-require "test/helper/env"
-require "test/helper/shutup"
+require "test/support/helper/env"
+require "test/support/helper/shutup"
 
 Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "*.rb")).each(&method(:require))
 
diff --git a/Library/Homebrew/cask/test/test_helper.rb b/Library/Homebrew/cask/test/test_helper.rb
index 73459cb25c..275ede3048 100644
--- a/Library/Homebrew/cask/test/test_helper.rb
+++ b/Library/Homebrew/cask/test/test_helper.rb
@@ -6,15 +6,15 @@ require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
 
 # add Homebrew to load path
 $LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
-$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
+$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
 
 require "global"
 
 # add Homebrew-Cask to load path
 $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
 
-require "test/helper/env"
-require "test/helper/shutup"
+require "test/support/helper/env"
+require "test/support/helper/shutup"
 include Test::Helper::Env
 include Test::Helper::Shutup
 
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.el_capitan.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.linux_x86_64.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.macintosh_intel.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mavericks.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.mountain_lion.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.sierra.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
diff --git a/Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz b/Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz
similarity index 100%
rename from Library/Homebrew/test/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz
rename to Library/Homebrew/test/support/fixtures/bottles/testball_bottle-0.1.yosemite.bottle.tar.gz
diff --git a/Library/Homebrew/test/fixtures/cask/AppWithBinary.zip b/Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/AppWithBinary.zip
rename to Library/Homebrew/test/support/fixtures/cask/AppWithBinary.zip
diff --git a/Library/Homebrew/test/fixtures/cask/AppWithEmbeddedBinary.zip b/Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/AppWithEmbeddedBinary.zip
rename to Library/Homebrew/test/support/fixtures/cask/AppWithEmbeddedBinary.zip
diff --git a/Library/Homebrew/test/fixtures/cask/MyFancyApp.zip b/Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/MyFancyApp.zip
rename to Library/Homebrew/test/support/fixtures/cask/MyFancyApp.zip
diff --git a/Library/Homebrew/test/fixtures/cask/MyFancyPkg.zip b/Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/MyFancyPkg.zip
rename to Library/Homebrew/test/support/fixtures/cask/MyFancyPkg.zip
diff --git a/Library/Homebrew/test/fixtures/cask/NestedApp.dmg.zip b/Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/NestedApp.dmg.zip
rename to Library/Homebrew/test/support/fixtures/cask/NestedApp.dmg.zip
diff --git a/Library/Homebrew/test/fixtures/cask/caffeine-suite.zip b/Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/caffeine-suite.zip
rename to Library/Homebrew/test/support/fixtures/cask/caffeine-suite.zip
diff --git a/Library/Homebrew/test/fixtures/cask/caffeine.zip b/Library/Homebrew/test/support/fixtures/cask/caffeine.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/caffeine.zip
rename to Library/Homebrew/test/support/fixtures/cask/caffeine.zip
diff --git a/Library/Homebrew/test/fixtures/cask/caffeines-subdir.zip b/Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/caffeines-subdir.zip
rename to Library/Homebrew/test/support/fixtures/cask/caffeines-subdir.zip
diff --git a/Library/Homebrew/test/fixtures/cask/caffeines.zip b/Library/Homebrew/test/support/fixtures/cask/caffeines.zip
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/caffeines.zip
rename to Library/Homebrew/test/support/fixtures/cask/caffeines.zip
diff --git a/Library/Homebrew/test/fixtures/cask/container.7z b/Library/Homebrew/test/support/fixtures/cask/container.7z
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.7z
rename to Library/Homebrew/test/support/fixtures/cask/container.7z
diff --git a/Library/Homebrew/test/fixtures/cask/container.air b/Library/Homebrew/test/support/fixtures/cask/container.air
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.air
rename to Library/Homebrew/test/support/fixtures/cask/container.air
diff --git a/Library/Homebrew/test/fixtures/cask/container.bz2 b/Library/Homebrew/test/support/fixtures/cask/container.bz2
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.bz2
rename to Library/Homebrew/test/support/fixtures/cask/container.bz2
diff --git a/Library/Homebrew/test/fixtures/cask/container.cab b/Library/Homebrew/test/support/fixtures/cask/container.cab
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.cab
rename to Library/Homebrew/test/support/fixtures/cask/container.cab
diff --git a/Library/Homebrew/test/fixtures/cask/container.dmg b/Library/Homebrew/test/support/fixtures/cask/container.dmg
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.dmg
rename to Library/Homebrew/test/support/fixtures/cask/container.dmg
diff --git a/Library/Homebrew/test/fixtures/cask/container.gz b/Library/Homebrew/test/support/fixtures/cask/container.gz
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.gz
rename to Library/Homebrew/test/support/fixtures/cask/container.gz
diff --git a/Library/Homebrew/test/fixtures/cask/container.lzma b/Library/Homebrew/test/support/fixtures/cask/container.lzma
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.lzma
rename to Library/Homebrew/test/support/fixtures/cask/container.lzma
diff --git a/Library/Homebrew/test/fixtures/cask/container.pkg b/Library/Homebrew/test/support/fixtures/cask/container.pkg
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.pkg
rename to Library/Homebrew/test/support/fixtures/cask/container.pkg
diff --git a/Library/Homebrew/test/fixtures/cask/container.rar b/Library/Homebrew/test/support/fixtures/cask/container.rar
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.rar
rename to Library/Homebrew/test/support/fixtures/cask/container.rar
diff --git a/Library/Homebrew/test/fixtures/cask/container.sit b/Library/Homebrew/test/support/fixtures/cask/container.sit
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.sit
rename to Library/Homebrew/test/support/fixtures/cask/container.sit
diff --git a/Library/Homebrew/test/fixtures/cask/container.tar.gz b/Library/Homebrew/test/support/fixtures/cask/container.tar.gz
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.tar.gz
rename to Library/Homebrew/test/support/fixtures/cask/container.tar.gz
diff --git a/Library/Homebrew/test/fixtures/cask/container.xar b/Library/Homebrew/test/support/fixtures/cask/container.xar
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.xar
rename to Library/Homebrew/test/support/fixtures/cask/container.xar
diff --git a/Library/Homebrew/test/fixtures/cask/container.xz b/Library/Homebrew/test/support/fixtures/cask/container.xz
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/container.xz
rename to Library/Homebrew/test/support/fixtures/cask/container.xz
diff --git a/Library/Homebrew/test/fixtures/cask/empty_directory/.gitignore b/Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/empty_directory/.gitignore
rename to Library/Homebrew/test/support/fixtures/cask/empty_directory/.gitignore
diff --git a/Library/Homebrew/test/fixtures/cask/naked_executable b/Library/Homebrew/test/support/fixtures/cask/naked_executable
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/naked_executable
rename to Library/Homebrew/test/support/fixtures/cask/naked_executable
diff --git a/Library/Homebrew/test/fixtures/cask/transmission-2.61.dmg b/Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg
similarity index 100%
rename from Library/Homebrew/test/fixtures/cask/transmission-2.61.dmg
rename to Library/Homebrew/test/support/fixtures/cask/transmission-2.61.dmg
diff --git a/Library/Homebrew/test/mach/a.out b/Library/Homebrew/test/support/fixtures/mach/a.out
similarity index 100%
rename from Library/Homebrew/test/mach/a.out
rename to Library/Homebrew/test/support/fixtures/mach/a.out
diff --git a/Library/Homebrew/test/mach/fat.bundle b/Library/Homebrew/test/support/fixtures/mach/fat.bundle
similarity index 100%
rename from Library/Homebrew/test/mach/fat.bundle
rename to Library/Homebrew/test/support/fixtures/mach/fat.bundle
diff --git a/Library/Homebrew/test/mach/fat.dylib b/Library/Homebrew/test/support/fixtures/mach/fat.dylib
similarity index 100%
rename from Library/Homebrew/test/mach/fat.dylib
rename to Library/Homebrew/test/support/fixtures/mach/fat.dylib
diff --git a/Library/Homebrew/test/mach/i386.bundle b/Library/Homebrew/test/support/fixtures/mach/i386.bundle
similarity index 100%
rename from Library/Homebrew/test/mach/i386.bundle
rename to Library/Homebrew/test/support/fixtures/mach/i386.bundle
diff --git a/Library/Homebrew/test/mach/i386.dylib b/Library/Homebrew/test/support/fixtures/mach/i386.dylib
similarity index 100%
rename from Library/Homebrew/test/mach/i386.dylib
rename to Library/Homebrew/test/support/fixtures/mach/i386.dylib
diff --git a/Library/Homebrew/test/mach/x86_64.bundle b/Library/Homebrew/test/support/fixtures/mach/x86_64.bundle
similarity index 100%
rename from Library/Homebrew/test/mach/x86_64.bundle
rename to Library/Homebrew/test/support/fixtures/mach/x86_64.bundle
diff --git a/Library/Homebrew/test/mach/x86_64.dylib b/Library/Homebrew/test/support/fixtures/mach/x86_64.dylib
similarity index 100%
rename from Library/Homebrew/test/mach/x86_64.dylib
rename to Library/Homebrew/test/support/fixtures/mach/x86_64.dylib
diff --git a/Library/Homebrew/test/patches/noop-a.diff b/Library/Homebrew/test/support/fixtures/patches/noop-a.diff
similarity index 100%
rename from Library/Homebrew/test/patches/noop-a.diff
rename to Library/Homebrew/test/support/fixtures/patches/noop-a.diff
diff --git a/Library/Homebrew/test/patches/noop-b.diff b/Library/Homebrew/test/support/fixtures/patches/noop-b.diff
similarity index 100%
rename from Library/Homebrew/test/patches/noop-b.diff
rename to Library/Homebrew/test/support/fixtures/patches/noop-b.diff
diff --git a/Library/Homebrew/test/patches/noop-c.diff b/Library/Homebrew/test/support/fixtures/patches/noop-c.diff
similarity index 100%
rename from Library/Homebrew/test/patches/noop-c.diff
rename to Library/Homebrew/test/support/fixtures/patches/noop-c.diff
diff --git a/Library/Homebrew/test/fixtures/receipt.json b/Library/Homebrew/test/support/fixtures/receipt.json
similarity index 100%
rename from Library/Homebrew/test/fixtures/receipt.json
rename to Library/Homebrew/test/support/fixtures/receipt.json
diff --git a/Library/Homebrew/test/fixtures/receipt_old.json b/Library/Homebrew/test/support/fixtures/receipt_old.json
similarity index 100%
rename from Library/Homebrew/test/fixtures/receipt_old.json
rename to Library/Homebrew/test/support/fixtures/receipt_old.json
diff --git a/Library/Homebrew/test/tarballs/testball-0.1-patches.tgz b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgz
similarity index 100%
rename from Library/Homebrew/test/tarballs/testball-0.1-patches.tgz
rename to Library/Homebrew/test/support/fixtures/tarballs/testball-0.1-patches.tgz
diff --git a/Library/Homebrew/test/tarballs/testball-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbz
similarity index 100%
rename from Library/Homebrew/test/tarballs/testball-0.1.tbz
rename to Library/Homebrew/test/support/fixtures/tarballs/testball-0.1.tbz
diff --git a/Library/Homebrew/test/tarballs/testbottest-0.1.tbz b/Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbz
similarity index 100%
rename from Library/Homebrew/test/tarballs/testbottest-0.1.tbz
rename to Library/Homebrew/test/support/fixtures/tarballs/testbottest-0.1.tbz
diff --git a/Library/Homebrew/test/fixtures/test.diff b/Library/Homebrew/test/support/fixtures/test.diff
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.diff
rename to Library/Homebrew/test/support/fixtures/test.diff
diff --git a/Library/Homebrew/test/fixtures/test.eps b/Library/Homebrew/test/support/fixtures/test.eps
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.eps
rename to Library/Homebrew/test/support/fixtures/test.eps
diff --git a/Library/Homebrew/test/fixtures/test.gif b/Library/Homebrew/test/support/fixtures/test.gif
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.gif
rename to Library/Homebrew/test/support/fixtures/test.gif
diff --git a/Library/Homebrew/test/fixtures/test.ico b/Library/Homebrew/test/support/fixtures/test.ico
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.ico
rename to Library/Homebrew/test/support/fixtures/test.ico
diff --git a/Library/Homebrew/test/fixtures/test.jpg b/Library/Homebrew/test/support/fixtures/test.jpg
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.jpg
rename to Library/Homebrew/test/support/fixtures/test.jpg
diff --git a/Library/Homebrew/test/fixtures/test.m4a b/Library/Homebrew/test/support/fixtures/test.m4a
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.m4a
rename to Library/Homebrew/test/support/fixtures/test.m4a
diff --git a/Library/Homebrew/test/fixtures/test.mp3 b/Library/Homebrew/test/support/fixtures/test.mp3
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.mp3
rename to Library/Homebrew/test/support/fixtures/test.mp3
diff --git a/Library/Homebrew/test/fixtures/test.pcap b/Library/Homebrew/test/support/fixtures/test.pcap
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.pcap
rename to Library/Homebrew/test/support/fixtures/test.pcap
diff --git a/Library/Homebrew/test/fixtures/test.pdf b/Library/Homebrew/test/support/fixtures/test.pdf
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.pdf
rename to Library/Homebrew/test/support/fixtures/test.pdf
diff --git a/Library/Homebrew/test/fixtures/test.png b/Library/Homebrew/test/support/fixtures/test.png
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.png
rename to Library/Homebrew/test/support/fixtures/test.png
diff --git a/Library/Homebrew/test/fixtures/test.ps b/Library/Homebrew/test/support/fixtures/test.ps
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.ps
rename to Library/Homebrew/test/support/fixtures/test.ps
diff --git a/Library/Homebrew/test/fixtures/test.svg b/Library/Homebrew/test/support/fixtures/test.svg
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.svg
rename to Library/Homebrew/test/support/fixtures/test.svg
diff --git a/Library/Homebrew/test/fixtures/test.tiff b/Library/Homebrew/test/support/fixtures/test.tiff
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.tiff
rename to Library/Homebrew/test/support/fixtures/test.tiff
diff --git a/Library/Homebrew/test/fixtures/test.wav b/Library/Homebrew/test/support/fixtures/test.wav
similarity index 100%
rename from Library/Homebrew/test/fixtures/test.wav
rename to Library/Homebrew/test/support/fixtures/test.wav
diff --git a/Library/Homebrew/test/testball.rb b/Library/Homebrew/test/support/fixtures/testball.rb
similarity index 78%
rename from Library/Homebrew/test/testball.rb
rename to Library/Homebrew/test/support/fixtures/testball.rb
index cce09738df..ba725f51e1 100644
--- a/Library/Homebrew/test/testball.rb
+++ b/Library/Homebrew/test/support/fixtures/testball.rb
@@ -1,7 +1,7 @@
 class Testball < Formula
   def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
     self.class.instance_eval do
-      stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
+      stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
       stable.sha256 TESTBALL_SHA256
     end
     super
diff --git a/Library/Homebrew/test/testball_bottle.rb b/Library/Homebrew/test/support/fixtures/testball_bottle.rb
similarity index 76%
rename from Library/Homebrew/test/testball_bottle.rb
rename to Library/Homebrew/test/support/fixtures/testball_bottle.rb
index 769f615aad..9453255e6e 100644
--- a/Library/Homebrew/test/testball_bottle.rb
+++ b/Library/Homebrew/test/support/fixtures/testball_bottle.rb
@@ -1,11 +1,11 @@
 class TestballBottle < Formula
   def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
     self.class.instance_eval do
-      stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
+      stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
       stable.sha256 TESTBALL_SHA256
       stable.bottle do
         cellar :any_skip_relocation
-        root_url "file://#{File.expand_path("..", __FILE__)}/bottles"
+        root_url "file://#{TEST_FIXTURE_DIR}/bottles"
         sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => Utils::Bottles.tag
       end
       cxxstdlib_check :skip
diff --git a/Library/Homebrew/test/testbottest.rb b/Library/Homebrew/test/support/fixtures/testbottest.rb
similarity index 82%
rename from Library/Homebrew/test/testbottest.rb
rename to Library/Homebrew/test/support/fixtures/testbottest.rb
index f7695cab5b..28b88567e8 100644
--- a/Library/Homebrew/test/testbottest.rb
+++ b/Library/Homebrew/test/support/fixtures/testbottest.rb
@@ -1,7 +1,7 @@
 class Testbottest < Formula
   desc "Minimal C program and Makefile used for testing Homebrew."
   homepage "https://github.com/Homebrew/brew"
-  url "file://#{File.expand_path("..", __FILE__)}/tarballs/testbottest-0.1.tbz"
+  url "file://#{TEST_FIXTURE_DIR}/tarballs/testbottest-0.1.tbz"
   sha256 "78b54d8f31585c9773bed12b4aa4ab2ce458ebd044b9406cb24d40aa5107f082"
 
   def install
diff --git a/Library/Homebrew/test/fixtures/updater_fixture.yaml b/Library/Homebrew/test/support/fixtures/updater_fixture.yaml
similarity index 100%
rename from Library/Homebrew/test/fixtures/updater_fixture.yaml
rename to Library/Homebrew/test/support/fixtures/updater_fixture.yaml
diff --git a/Library/Homebrew/test/helper/env.rb b/Library/Homebrew/test/support/helper/env.rb
similarity index 100%
rename from Library/Homebrew/test/helper/env.rb
rename to Library/Homebrew/test/support/helper/env.rb
diff --git a/Library/Homebrew/test/helper/integration_command_test_case.rb b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
similarity index 96%
rename from Library/Homebrew/test/helper/integration_command_test_case.rb
rename to Library/Homebrew/test/support/helper/integration_command_test_case.rb
index 2f137e14a3..d7ae674234 100644
--- a/Library/Homebrew/test/helper/integration_command_test_case.rb
+++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
@@ -1,5 +1,4 @@
 require "bundler"
-require "testing_env"
 require "fileutils"
 require "pathname"
 require "formula"
@@ -21,6 +20,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
       HOMEBREW_LOCK_DIR.children,
       HOMEBREW_LOGS.children,
       HOMEBREW_TEMP.children,
+      HOMEBREW_PREFIX/".git",
       HOMEBREW_PREFIX/"bin",
       HOMEBREW_PREFIX/"share",
       HOMEBREW_PREFIX/"opt",
@@ -59,7 +59,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
     env = args.last.is_a?(Hash) ? args.pop : {}
     cmd_args = %W[
       -W0
-      -I#{HOMEBREW_LIBRARY_PATH}/test/lib
+      -I#{HOMEBREW_LIBRARY_PATH}/test/support/lib
       -rconfig
     ]
     if ENV["HOMEBREW_TESTS_COVERAGE"]
@@ -125,7 +125,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
       content = <<-EOS.undent
         desc "Some test"
         homepage "https://example.com/#{name}"
-        url "file://#{File.expand_path("../..", __FILE__)}/tarballs/testball-0.1.tbz"
+        url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
         sha256 "#{TESTBALL_SHA256}"
 
         option "with-foo", "Build with foo"
@@ -195,6 +195,6 @@ class IntegrationCommandTestCase < Homebrew::TestCase
   end
 
   def testball
-    "#{File.expand_path("../..", __FILE__)}/testball.rb"
+    "#{TEST_FIXTURE_DIR}/testball.rb"
   end
 end
diff --git a/Library/Homebrew/test/helper/shutup.rb b/Library/Homebrew/test/support/helper/shutup.rb
similarity index 100%
rename from Library/Homebrew/test/helper/shutup.rb
rename to Library/Homebrew/test/support/helper/shutup.rb
diff --git a/Library/Homebrew/test/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb
similarity index 95%
rename from Library/Homebrew/test/lib/config.rb
rename to Library/Homebrew/test/support/lib/config.rb
index 4fe62d4090..f6fdb4ecbf 100644
--- a/Library/Homebrew/test/lib/config.rb
+++ b/Library/Homebrew/test/support/lib/config.rb
@@ -14,7 +14,7 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
 end
 
 # Paths pointing into the Homebrew code base that persist across test runs
-HOMEBREW_LIBRARY_PATH  = Pathname.new(File.expand_path("../../..", __FILE__))
+HOMEBREW_LIBRARY_PATH  = Pathname.new(File.expand_path("../../../..", __FILE__))
 HOMEBREW_SHIMS_PATH    = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
 HOMEBREW_LOAD_PATH     = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
 
@@ -31,7 +31,7 @@ HOMEBREW_CELLAR        = HOMEBREW_PREFIX.parent+"cellar"
 HOMEBREW_LOGS          = HOMEBREW_PREFIX.parent+"logs"
 HOMEBREW_TEMP          = HOMEBREW_PREFIX.parent+"temp"
 
-TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH.join("test", "fixtures")
+TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH.join("test", "support", "fixtures")
 
 TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37".freeze
 TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b".freeze
diff --git a/Library/Homebrew/test/lib/integration_mocks.rb b/Library/Homebrew/test/support/lib/integration_mocks.rb
similarity index 100%
rename from Library/Homebrew/test/lib/integration_mocks.rb
rename to Library/Homebrew/test/support/lib/integration_mocks.rb
diff --git a/Library/Homebrew/test/test/ENV_test.rb b/Library/Homebrew/test/test/ENV_test.rb
index e38c75c6e4..1736d34af5 100644
--- a/Library/Homebrew/test/test/ENV_test.rb
+++ b/Library/Homebrew/test/test/ENV_test.rb
@@ -1,6 +1,7 @@
 require "testing_env"
 require "extend/ENV"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestEnv < IntegrationCommandTestCase
   def test_env
diff --git a/Library/Homebrew/test/test/analytics_test.rb b/Library/Homebrew/test/test/analytics_test.rb
index 00e0593db4..266c5bd098 100644
--- a/Library/Homebrew/test/test/analytics_test.rb
+++ b/Library/Homebrew/test/test/analytics_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestAnalytics < IntegrationCommandTestCase
   def test_analytics
diff --git a/Library/Homebrew/test/test/bottle_test.rb b/Library/Homebrew/test/test/bottle_test.rb
index 48727cfd90..5fdba0af82 100644
--- a/Library/Homebrew/test/test/bottle_test.rb
+++ b/Library/Homebrew/test/test/bottle_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestBottle < IntegrationCommandTestCase
   def test_bottle
diff --git a/Library/Homebrew/test/test/bundle_test.rb b/Library/Homebrew/test/test/bundle_test.rb
index 6b040df1db..ea18d5f843 100644
--- a/Library/Homebrew/test/test/bundle_test.rb
+++ b/Library/Homebrew/test/test/bundle_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestBundle < IntegrationCommandTestCase
   def test_bundle
diff --git a/Library/Homebrew/test/test/cache_formula_test.rb b/Library/Homebrew/test/test/cache_formula_test.rb
index f4e37e2a2e..c64ce9809a 100644
--- a/Library/Homebrew/test/test/cache_formula_test.rb
+++ b/Library/Homebrew/test/test/cache_formula_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase
   def test_cache_formula
diff --git a/Library/Homebrew/test/test/cache_test.rb b/Library/Homebrew/test/test/cache_test.rb
index cd7a5e2fab..f8c0356761 100644
--- a/Library/Homebrew/test/test/cache_test.rb
+++ b/Library/Homebrew/test/test/cache_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCache < IntegrationCommandTestCase
   def test_cache
diff --git a/Library/Homebrew/test/test/cask_test.rb b/Library/Homebrew/test/test/cask_test.rb
index 6cae6d54ba..ad7a2a0a0e 100644
--- a/Library/Homebrew/test/test/cask_test.rb
+++ b/Library/Homebrew/test/test/cask_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCask < IntegrationCommandTestCase
   def test_cask
diff --git a/Library/Homebrew/test/test/cat_test.rb b/Library/Homebrew/test/test/cat_test.rb
index 4cfd19c3dc..df64188d6c 100644
--- a/Library/Homebrew/test/test/cat_test.rb
+++ b/Library/Homebrew/test/test/cat_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCat < IntegrationCommandTestCase
   def test_cat
diff --git a/Library/Homebrew/test/test/cellar_formula_test.rb b/Library/Homebrew/test/test/cellar_formula_test.rb
index 7c458be9d0..6c3063ca3b 100644
--- a/Library/Homebrew/test/test/cellar_formula_test.rb
+++ b/Library/Homebrew/test/test/cellar_formula_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase
   def test_cellar_formula
diff --git a/Library/Homebrew/test/test/cellar_test.rb b/Library/Homebrew/test/test/cellar_test.rb
index b793c53424..32cdb1af50 100644
--- a/Library/Homebrew/test/test/cellar_test.rb
+++ b/Library/Homebrew/test/test/cellar_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCellar < IntegrationCommandTestCase
   def test_cellar
diff --git a/Library/Homebrew/test/test/checksum_verification_test.rb b/Library/Homebrew/test/test/checksum_verification_test.rb
index e25d08b833..9017b528d0 100644
--- a/Library/Homebrew/test/test/checksum_verification_test.rb
+++ b/Library/Homebrew/test/test/checksum_verification_test.rb
@@ -12,7 +12,7 @@ class ChecksumVerificationTests < Homebrew::TestCase
 
   def formula(&block)
     super do
-      url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
+      url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
       instance_eval(&block)
     end
   end
diff --git a/Library/Homebrew/test/test/cleaner_test.rb b/Library/Homebrew/test/test/cleaner_test.rb
index 450a78d86a..ac108421c8 100644
--- a/Library/Homebrew/test/test/cleaner_test.rb
+++ b/Library/Homebrew/test/test/cleaner_test.rb
@@ -17,8 +17,8 @@ class CleanerTests < Homebrew::TestCase
   def test_clean_file
     @f.bin.mkpath
     @f.lib.mkpath
-    cp "#{TEST_DIRECTORY}/mach/a.out", @f.bin
-    cp Dir["#{TEST_DIRECTORY}/mach/*.dylib"], @f.lib
+    cp "#{TEST_FIXTURE_DIR}/mach/a.out", @f.bin
+    cp Dir["#{TEST_FIXTURE_DIR}/mach/*.dylib"], @f.lib
 
     Cleaner.new(@f).clean
 
diff --git a/Library/Homebrew/test/test/cleanup_test.rb b/Library/Homebrew/test/test/cleanup_test.rb
index dffcd12f2f..fef249fcba 100644
--- a/Library/Homebrew/test/test/cleanup_test.rb
+++ b/Library/Homebrew/test/test/cleanup_test.rb
@@ -1,9 +1,10 @@
 require "testing_env"
-require "testball"
+require "test/support/fixtures/testball"
 require "cleanup"
 require "fileutils"
 require "pathname"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCleanup < IntegrationCommandTestCase
   def test_cleanup
diff --git a/Library/Homebrew/test/test/command_test.rb b/Library/Homebrew/test/test/command_test.rb
index d051846313..620a014b91 100644
--- a/Library/Homebrew/test/test/command_test.rb
+++ b/Library/Homebrew/test/test/command_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCommand < IntegrationCommandTestCase
   def test_command
diff --git a/Library/Homebrew/test/test/commands_test.rb b/Library/Homebrew/test/test/commands_test.rb
index ef138049c1..cbb446ae3d 100644
--- a/Library/Homebrew/test/test/commands_test.rb
+++ b/Library/Homebrew/test/test/commands_test.rb
@@ -2,7 +2,8 @@ require "testing_env"
 require "cmd/command"
 require "cmd/commands"
 require "fileutils"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCommands < IntegrationCommandTestCase
   def test_commands
diff --git a/Library/Homebrew/test/test/config_test.rb b/Library/Homebrew/test/test/config_test.rb
index 33a2937357..1a793cc6be 100644
--- a/Library/Homebrew/test/test/config_test.rb
+++ b/Library/Homebrew/test/test/config_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestConfig < IntegrationCommandTestCase
   def test_config
diff --git a/Library/Homebrew/test/test/create_test.rb b/Library/Homebrew/test/test/create_test.rb
index 5f194ea023..26a325a22f 100644
--- a/Library/Homebrew/test/test/create_test.rb
+++ b/Library/Homebrew/test/test/create_test.rb
@@ -1,8 +1,9 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCreate < IntegrationCommandTestCase
   def test_create
-    url = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
+    url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
     cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat")
 
     formula_file = CoreTap.new.formula_dir/"testball.rb"
diff --git a/Library/Homebrew/test/test/custom_command_test.rb b/Library/Homebrew/test/test/custom_command_test.rb
index bc27e2121e..71bfafd9b5 100644
--- a/Library/Homebrew/test/test/custom_command_test.rb
+++ b/Library/Homebrew/test/test/custom_command_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase
   def test_custom_command
diff --git a/Library/Homebrew/test/test/deps_test.rb b/Library/Homebrew/test/test/deps_test.rb
index 83cc9aa6a7..44803af5e5 100644
--- a/Library/Homebrew/test/test/deps_test.rb
+++ b/Library/Homebrew/test/test/deps_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestDeps < IntegrationCommandTestCase
   def test_deps
diff --git a/Library/Homebrew/test/test/desc_test.rb b/Library/Homebrew/test/test/desc_test.rb
index 075ea991a2..7428c07924 100644
--- a/Library/Homebrew/test/test/desc_test.rb
+++ b/Library/Homebrew/test/test/desc_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestDesc < IntegrationCommandTestCase
   def test_desc
diff --git a/Library/Homebrew/test/test/doctor_test.rb b/Library/Homebrew/test/test/doctor_test.rb
index ccb909dce0..be1098d22b 100644
--- a/Library/Homebrew/test/test/doctor_test.rb
+++ b/Library/Homebrew/test/test/doctor_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestDoctor < IntegrationCommandTestCase
   def test_doctor
diff --git a/Library/Homebrew/test/test/edit_test.rb b/Library/Homebrew/test/test/edit_test.rb
index 8d14371730..c78db3bd80 100644
--- a/Library/Homebrew/test/test/edit_test.rb
+++ b/Library/Homebrew/test/test/edit_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestEdit < IntegrationCommandTestCase
   def test_edit
diff --git a/Library/Homebrew/test/test/fetch_test.rb b/Library/Homebrew/test/test/fetch_test.rb
index 7b57c62469..e049db5541 100644
--- a/Library/Homebrew/test/test/fetch_test.rb
+++ b/Library/Homebrew/test/test/fetch_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestFetch < IntegrationCommandTestCase
   def test_fetch
diff --git a/Library/Homebrew/test/test/formula_installer_bottle_test.rb b/Library/Homebrew/test/test/formula_installer_bottle_test.rb
index d83c856b7f..6a891f1591 100644
--- a/Library/Homebrew/test/test/formula_installer_bottle_test.rb
+++ b/Library/Homebrew/test/test/formula_installer_bottle_test.rb
@@ -3,8 +3,8 @@ require "formula"
 require "formula_installer"
 require "keg"
 require "tab"
-require "testball"
-require "testball_bottle"
+require "test/support/fixtures/testball"
+require "test/support/fixtures/testball_bottle"
 
 class InstallBottleTests < Homebrew::TestCase
   def temporary_bottle_install(formula)
diff --git a/Library/Homebrew/test/test/formula_installer_test.rb b/Library/Homebrew/test/test/formula_installer_test.rb
index 18bd910a67..652548bd78 100644
--- a/Library/Homebrew/test/test/formula_installer_test.rb
+++ b/Library/Homebrew/test/test/formula_installer_test.rb
@@ -3,8 +3,8 @@ require "formula"
 require "formula_installer"
 require "keg"
 require "tab"
-require "testball"
-require "testball_bottle"
+require "test/support/fixtures/testball"
+require "test/support/fixtures/testball_bottle"
 
 class InstallTests < Homebrew::TestCase
   def temporary_install(formula)
diff --git a/Library/Homebrew/test/test/formula_test.rb b/Library/Homebrew/test/test/formula_test.rb
index 4aa8355909..eef60a3e5f 100644
--- a/Library/Homebrew/test/test/formula_test.rb
+++ b/Library/Homebrew/test/test/formula_test.rb
@@ -1,5 +1,5 @@
 require "testing_env"
-require "testball"
+require "test/support/fixtures/testball"
 require "formula"
 
 class FormulaTests < Homebrew::TestCase
diff --git a/Library/Homebrew/test/test/formulary_test.rb b/Library/Homebrew/test/test/formulary_test.rb
index 690ff089a7..3d88c84077 100644
--- a/Library/Homebrew/test/test/formulary_test.rb
+++ b/Library/Homebrew/test/test/formulary_test.rb
@@ -18,11 +18,11 @@ class FormularyFactoryTest < Homebrew::TestCase
   def setup
     @name = "testball_bottle"
     @path = CoreTap.new.formula_dir/"#{@name}.rb"
-    @bottle_dir = Pathname.new("#{TEST_DIRECTORY}/bottles")
+    @bottle_dir = Pathname.new("#{TEST_FIXTURE_DIR}/bottles")
     @bottle = @bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz"
     @path.write <<-EOS.undent
       class #{Formulary.class_s(@name)} < Formula
-        url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
+        url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
         sha256 TESTBALL_SHA256
 
         bottle do
diff --git a/Library/Homebrew/test/test/help_test.rb b/Library/Homebrew/test/test/help_test.rb
index 9c14f9b78f..8c9a4bb081 100644
--- a/Library/Homebrew/test/test/help_test.rb
+++ b/Library/Homebrew/test/test/help_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestHelp < IntegrationCommandTestCase
   def test_help
diff --git a/Library/Homebrew/test/test/home_test.rb b/Library/Homebrew/test/test/home_test.rb
index 9c26353bec..9116442b7b 100644
--- a/Library/Homebrew/test/test/home_test.rb
+++ b/Library/Homebrew/test/test/home_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestHome < IntegrationCommandTestCase
   def test_home
diff --git a/Library/Homebrew/test/test/info_test.rb b/Library/Homebrew/test/test/info_test.rb
index 35f9183e13..a4186a5e9a 100644
--- a/Library/Homebrew/test/test/info_test.rb
+++ b/Library/Homebrew/test/test/info_test.rb
@@ -1,7 +1,8 @@
 require "testing_env"
 require "cmd/info"
 require "formula"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestInfo < IntegrationCommandTestCase
   def test_info
diff --git a/Library/Homebrew/test/test/install_test.rb b/Library/Homebrew/test/test/install_test.rb
index 7135dddb2d..3131259311 100644
--- a/Library/Homebrew/test/test/install_test.rb
+++ b/Library/Homebrew/test/test/install_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestInstall < IntegrationCommandTestCase
   def test_install
diff --git a/Library/Homebrew/test/test/irb_test.rb b/Library/Homebrew/test/test/irb_test.rb
index bf35b65241..77ca4a90db 100644
--- a/Library/Homebrew/test/test/irb_test.rb
+++ b/Library/Homebrew/test/test/irb_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestIrb < IntegrationCommandTestCase
   def test_irb
diff --git a/Library/Homebrew/test/test/leaves_test.rb b/Library/Homebrew/test/test/leaves_test.rb
index 2a9bbadd97..ef25a4b6eb 100644
--- a/Library/Homebrew/test/test/leaves_test.rb
+++ b/Library/Homebrew/test/test/leaves_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestLeaves < IntegrationCommandTestCase
   def test_leaves
diff --git a/Library/Homebrew/test/test/link_test.rb b/Library/Homebrew/test/test/link_test.rb
index 3f05070724..ecabe0c675 100644
--- a/Library/Homebrew/test/test/link_test.rb
+++ b/Library/Homebrew/test/test/link_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestLink < IntegrationCommandTestCase
   def test_link
diff --git a/Library/Homebrew/test/test/linkapps_test.rb b/Library/Homebrew/test/test/linkapps_test.rb
index b7c4cb8114..a0b33a543d 100644
--- a/Library/Homebrew/test/test/linkapps_test.rb
+++ b/Library/Homebrew/test/test/linkapps_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestLinkapps < IntegrationCommandTestCase
   def test_linkapps
diff --git a/Library/Homebrew/test/test/list_test.rb b/Library/Homebrew/test/test/list_test.rb
index 1ffdb45286..26aab741f4 100644
--- a/Library/Homebrew/test/test/list_test.rb
+++ b/Library/Homebrew/test/test/list_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestList < IntegrationCommandTestCase
   def test_list
diff --git a/Library/Homebrew/test/test/log_formula_test.rb b/Library/Homebrew/test/test/log_formula_test.rb
index 34509bf72b..26c10d3812 100644
--- a/Library/Homebrew/test/test/log_formula_test.rb
+++ b/Library/Homebrew/test/test/log_formula_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestLogFormula < IntegrationCommandTestCase
   def test_log_formula
diff --git a/Library/Homebrew/test/test/log_test.rb b/Library/Homebrew/test/test/log_test.rb
index b20a098fd8..c9eb73d978 100644
--- a/Library/Homebrew/test/test/log_test.rb
+++ b/Library/Homebrew/test/test/log_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestLog < IntegrationCommandTestCase
   def test_log
diff --git a/Library/Homebrew/test/test/migrate_test.rb b/Library/Homebrew/test/test/migrate_test.rb
index 53b32777a3..c267629a31 100644
--- a/Library/Homebrew/test/test/migrate_test.rb
+++ b/Library/Homebrew/test/test/migrate_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestMigrate < IntegrationCommandTestCase
   def test_migrate
diff --git a/Library/Homebrew/test/test/migrator_test.rb b/Library/Homebrew/test/test/migrator_test.rb
index cefb8b7a34..8a2b6ad63e 100644
--- a/Library/Homebrew/test/test/migrator_test.rb
+++ b/Library/Homebrew/test/test/migrator_test.rb
@@ -1,6 +1,6 @@
 require "testing_env"
 require "migrator"
-require "testball"
+require "test/support/fixtures/testball"
 require "tab"
 require "keg"
 
diff --git a/Library/Homebrew/test/test/missing_test.rb b/Library/Homebrew/test/test/missing_test.rb
index 565f413daf..9ad0ab0b8c 100644
--- a/Library/Homebrew/test/test/missing_test.rb
+++ b/Library/Homebrew/test/test/missing_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestMissing < IntegrationCommandTestCase
   def setup
diff --git a/Library/Homebrew/test/test/options_test.rb b/Library/Homebrew/test/test/options_test.rb
index bfde7a9b64..43ea26b97e 100644
--- a/Library/Homebrew/test/test/options_test.rb
+++ b/Library/Homebrew/test/test/options_test.rb
@@ -1,6 +1,7 @@
 require "testing_env"
 require "options"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestOptions < IntegrationCommandTestCase
   def test_options
diff --git a/Library/Homebrew/test/test/os/mac/mach_test.rb b/Library/Homebrew/test/test/os/mac/mach_test.rb
index 404a21d603..a42f7316b1 100644
--- a/Library/Homebrew/test/test/os/mac/mach_test.rb
+++ b/Library/Homebrew/test/test/os/mac/mach_test.rb
@@ -41,7 +41,7 @@ class MachOPathnameTests < Homebrew::TestCase
   end
 
   def test_mach_o_executable
-    pn = Pathname.new("#{TEST_DIRECTORY}/mach/a.out")
+    pn = Pathname.new("#{TEST_FIXTURE_DIR}/mach/a.out")
     assert_predicate pn, :universal?
     refute_predicate pn, :i386?
     refute_predicate pn, :x86_64?
@@ -93,7 +93,7 @@ class MachOPathnameTests < Homebrew::TestCase
   end
 
   def test_non_mach_o
-    pn = Pathname.new("#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz")
+    pn = Pathname.new("#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz")
     refute_predicate pn, :universal?
     refute_predicate pn, :i386?
     refute_predicate pn, :x86_64?
diff --git a/Library/Homebrew/test/test/outdated_test.rb b/Library/Homebrew/test/test/outdated_test.rb
index cc0f024c8d..03c2293d8c 100644
--- a/Library/Homebrew/test/test/outdated_test.rb
+++ b/Library/Homebrew/test/test/outdated_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestOutdated < IntegrationCommandTestCase
   def test_outdated
diff --git a/Library/Homebrew/test/test/patching_test.rb b/Library/Homebrew/test/test/patching_test.rb
index 18b848b10e..ac14c8e1e7 100644
--- a/Library/Homebrew/test/test/patching_test.rb
+++ b/Library/Homebrew/test/test/patching_test.rb
@@ -2,12 +2,12 @@ require "testing_env"
 require "formula"
 
 class PatchingTests < Homebrew::TestCase
-  TESTBALL_URL = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz".freeze
-  TESTBALL_PATCHES_URL = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1-patches.tgz".freeze
-  PATCH_URL_A = "file://#{TEST_DIRECTORY}/patches/noop-a.diff".freeze
-  PATCH_URL_B = "file://#{TEST_DIRECTORY}/patches/noop-b.diff".freeze
-  PATCH_A_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-a.diff"
-  PATCH_B_CONTENTS = File.read "#{TEST_DIRECTORY}/patches/noop-b.diff"
+  TESTBALL_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz".freeze
+  TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze
+  PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze
+  PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff".freeze
+  PATCH_A_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-a.diff"
+  PATCH_B_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/noop-b.diff"
   APPLY_A = "noop-a.diff".freeze
   APPLY_B = "noop-b.diff".freeze
   APPLY_C = "noop-c.diff".freeze
diff --git a/Library/Homebrew/test/test/pin_unpin_test.rb b/Library/Homebrew/test/test/pin_unpin_test.rb
index 37682d45ee..9603620a30 100644
--- a/Library/Homebrew/test/test/pin_unpin_test.rb
+++ b/Library/Homebrew/test/test/pin_unpin_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase
   def test_pin_unpin
diff --git a/Library/Homebrew/test/test/prefix_formula_test.rb b/Library/Homebrew/test/test/prefix_formula_test.rb
index d76a966d73..e51de2b6f0 100644
--- a/Library/Homebrew/test/test/prefix_formula_test.rb
+++ b/Library/Homebrew/test/test/prefix_formula_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPrefixFormula < IntegrationCommandTestCase
   def test_prefix_formula
diff --git a/Library/Homebrew/test/test/prefix_test.rb b/Library/Homebrew/test/test/prefix_test.rb
index 4aa63fa071..1b21148078 100644
--- a/Library/Homebrew/test/test/prefix_test.rb
+++ b/Library/Homebrew/test/test/prefix_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPrefix < IntegrationCommandTestCase
   def test_prefix
diff --git a/Library/Homebrew/test/test/prune_test.rb b/Library/Homebrew/test/test/prune_test.rb
index 293a3746dd..b810621123 100644
--- a/Library/Homebrew/test/test/prune_test.rb
+++ b/Library/Homebrew/test/test/prune_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPrune < IntegrationCommandTestCase
   def test_prune
diff --git a/Library/Homebrew/test/test/pull_offline_test.rb b/Library/Homebrew/test/test/pull_offline_test.rb
index 2716af346d..1429ca62e3 100644
--- a/Library/Homebrew/test/test/pull_offline_test.rb
+++ b/Library/Homebrew/test/test/pull_offline_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPullOffline < IntegrationCommandTestCase
   def test_pull_offline
diff --git a/Library/Homebrew/test/test/pull_test.rb b/Library/Homebrew/test/test/pull_test.rb
index 9707ff8a82..f772454bab 100644
--- a/Library/Homebrew/test/test/pull_test.rb
+++ b/Library/Homebrew/test/test/pull_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestPull < IntegrationCommandTestCase
   def test_pull
diff --git a/Library/Homebrew/test/test/readall_test.rb b/Library/Homebrew/test/test/readall_test.rb
index d0c078e493..cbb304ca1b 100644
--- a/Library/Homebrew/test/test/readall_test.rb
+++ b/Library/Homebrew/test/test/readall_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestReadall < IntegrationCommandTestCase
   def test_readall
diff --git a/Library/Homebrew/test/test/reinstall_pinned_test.rb b/Library/Homebrew/test/test/reinstall_pinned_test.rb
index c9cb8a849f..36f5cfd74b 100644
--- a/Library/Homebrew/test/test/reinstall_pinned_test.rb
+++ b/Library/Homebrew/test/test/reinstall_pinned_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestReinstallPinned < IntegrationCommandTestCase
   def test_reinstall_pinned
diff --git a/Library/Homebrew/test/test/reinstall_test.rb b/Library/Homebrew/test/test/reinstall_test.rb
index d07a960517..5018301027 100644
--- a/Library/Homebrew/test/test/reinstall_test.rb
+++ b/Library/Homebrew/test/test/reinstall_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestReinstall < IntegrationCommandTestCase
   def test_reinstall
diff --git a/Library/Homebrew/test/test/repository_test.rb b/Library/Homebrew/test/test/repository_test.rb
index 2029876ad7..352ab1d42b 100644
--- a/Library/Homebrew/test/test/repository_test.rb
+++ b/Library/Homebrew/test/test/repository_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestRepository < IntegrationCommandTestCase
   def test_repository
diff --git a/Library/Homebrew/test/test/search_test.rb b/Library/Homebrew/test/test/search_test.rb
index 8310d1c2b2..95e555bf24 100644
--- a/Library/Homebrew/test/test/search_test.rb
+++ b/Library/Homebrew/test/test/search_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestSearch < IntegrationCommandTestCase
   def test_search
diff --git a/Library/Homebrew/test/test/services_test.rb b/Library/Homebrew/test/test/services_test.rb
index b5ccb7c778..94fba4675f 100644
--- a/Library/Homebrew/test/test/services_test.rb
+++ b/Library/Homebrew/test/test/services_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestServices < IntegrationCommandTestCase
   def test_services
diff --git a/Library/Homebrew/test/test/sh_test.rb b/Library/Homebrew/test/test/sh_test.rb
index 449b7b5b3e..67593b17e4 100644
--- a/Library/Homebrew/test/test/sh_test.rb
+++ b/Library/Homebrew/test/test/sh_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestSh < IntegrationCommandTestCase
   def test_sh
diff --git a/Library/Homebrew/test/test/switch_test.rb b/Library/Homebrew/test/test/switch_test.rb
index 88fdf85b98..766d244940 100644
--- a/Library/Homebrew/test/test/switch_test.rb
+++ b/Library/Homebrew/test/test/switch_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestSwitch < IntegrationCommandTestCase
   def test_switch
diff --git a/Library/Homebrew/test/test/tab_test.rb b/Library/Homebrew/test/test/tab_test.rb
index 2c756cf685..76c9aacc9f 100644
--- a/Library/Homebrew/test/test/tab_test.rb
+++ b/Library/Homebrew/test/test/tab_test.rb
@@ -218,7 +218,7 @@ class TabLoadingTests < Homebrew::TestCase
     @f = formula { url "foo-1.0" }
     @f.prefix.mkpath
     @path = @f.prefix.join(Tab::FILENAME)
-    @path.write Pathname.new(TEST_DIRECTORY).join("fixtures", "receipt.json").read
+    @path.write TEST_FIXTURE_DIR.join("receipt.json").read
   end
 
   def teardown
diff --git a/Library/Homebrew/test/test/tap_new_test.rb b/Library/Homebrew/test/test/tap_new_test.rb
index 636024b0aa..57ad4a08e2 100644
--- a/Library/Homebrew/test/test/tap_new_test.rb
+++ b/Library/Homebrew/test/test/tap_new_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestTapNew < IntegrationCommandTestCase
   def test_tap_readme
diff --git a/Library/Homebrew/test/test/tap_test.rb b/Library/Homebrew/test/test/tap_test.rb
index 71836aee94..94597cdb3f 100644
--- a/Library/Homebrew/test/test/tap_test.rb
+++ b/Library/Homebrew/test/test/tap_test.rb
@@ -1,5 +1,6 @@
 require "testing_env"
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestTap < IntegrationCommandTestCase
   def test_tap
diff --git a/Library/Homebrew/test/test/test_formula_test.rb b/Library/Homebrew/test/test/test_formula_test.rb
index b3889d6a2f..cab4db7409 100644
--- a/Library/Homebrew/test/test/test_formula_test.rb
+++ b/Library/Homebrew/test/test/test_formula_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestTestFormula < IntegrationCommandTestCase
   def test_test_formula
@@ -13,7 +14,7 @@ class IntegrationCommandTestTestFormula < IntegrationCommandTestCase
       head "https://github.com/example/testball2.git"
 
       devel do
-        url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
+        url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
         sha256 "#{TESTBALL_SHA256}"
       end
 
diff --git a/Library/Homebrew/test/test/uninstall_test.rb b/Library/Homebrew/test/test/uninstall_test.rb
index d86db0e805..ffc6f0db7a 100644
--- a/Library/Homebrew/test/test/uninstall_test.rb
+++ b/Library/Homebrew/test/test/uninstall_test.rb
@@ -1,4 +1,4 @@
-require "helper/integration_command_test_case"
+require "test/support/helper/integration_command_test_case"
 require "cmd/uninstall"
 
 class UninstallTests < Homebrew::TestCase
diff --git a/Library/Homebrew/test/test/unlink_test.rb b/Library/Homebrew/test/test/unlink_test.rb
index 091bd8c45b..a307dc638b 100644
--- a/Library/Homebrew/test/test/unlink_test.rb
+++ b/Library/Homebrew/test/test/unlink_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestUnlink < IntegrationCommandTestCase
   def test_unlink
diff --git a/Library/Homebrew/test/test/unlinkapps_test.rb b/Library/Homebrew/test/test/unlinkapps_test.rb
index 2de4e3ff8a..2dbbd84e91 100644
--- a/Library/Homebrew/test/test/unlinkapps_test.rb
+++ b/Library/Homebrew/test/test/unlinkapps_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestUnlinkapps < IntegrationCommandTestCase
   def test_unlinkapps
diff --git a/Library/Homebrew/test/test/unpack_test.rb b/Library/Homebrew/test/test/unpack_test.rb
index de1452a297..e044e713ba 100644
--- a/Library/Homebrew/test/test/unpack_test.rb
+++ b/Library/Homebrew/test/test/unpack_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestUnpack < IntegrationCommandTestCase
   def test_unpack
diff --git a/Library/Homebrew/test/test/upgrade_test.rb b/Library/Homebrew/test/test/upgrade_test.rb
index 73618293bc..7c74ca70e2 100644
--- a/Library/Homebrew/test/test/upgrade_test.rb
+++ b/Library/Homebrew/test/test/upgrade_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestUpgrade < IntegrationCommandTestCase
   def test_upgrade
diff --git a/Library/Homebrew/test/test/uses_test.rb b/Library/Homebrew/test/test/uses_test.rb
index b0e79ef2d8..494ce4d6e8 100644
--- a/Library/Homebrew/test/test/uses_test.rb
+++ b/Library/Homebrew/test/test/uses_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestUses < IntegrationCommandTestCase
   def test_uses
diff --git a/Library/Homebrew/test/test/version_test.rb b/Library/Homebrew/test/test/version_test.rb
index ca37e3567a..a783eda690 100644
--- a/Library/Homebrew/test/test/version_test.rb
+++ b/Library/Homebrew/test/test/version_test.rb
@@ -1,4 +1,5 @@
-require "helper/integration_command_test_case"
+require "testing_env"
+require "test/support/helper/integration_command_test_case"
 
 class IntegrationCommandTestVersion < IntegrationCommandTestCase
   def test_version
diff --git a/Library/Homebrew/test/testing_env.rb b/Library/Homebrew/test/testing_env.rb
index d441b4f1c8..76b943164b 100644
--- a/Library/Homebrew/test/testing_env.rb
+++ b/Library/Homebrew/test/testing_env.rb
@@ -1,5 +1,5 @@
 $:.unshift File.expand_path("../..", __FILE__)
-$:.unshift File.expand_path("../lib", __FILE__)
+$:.unshift File.expand_path("../support/lib", __FILE__)
 
 require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
 require "global"
@@ -9,9 +9,6 @@ require "formulary"
 (HOMEBREW_LIBRARY/"Taps/homebrew/homebrew-core/Formula").mkpath
 %w[cache formula_cache locks cellar logs temp].each { |d| HOMEBREW_PREFIX.parent.join(d).mkpath }
 
-# Test fixtures and files can be found relative to this path
-TEST_DIRECTORY = File.dirname(File.expand_path(__FILE__))
-
 begin
   require "rubygems"
   require "minitest/autorun"
@@ -43,7 +40,9 @@ module Homebrew
   module FSLeakLogger
     def self.included(klass)
       require "find"
-      @@log = File.open(HOMEBREW_LIBRARY_PATH/"tmp/fs_leak.log", "w")
+      logdir = HOMEBREW_LIBRARY_PATH.join("tmp")
+      logdir.mkdir unless logdir.directory?
+      @@log = File.open(logdir.join("fs_leak.log"), "w")
       klass.make_my_diffs_pretty!
     end
 
@@ -63,8 +62,8 @@ module Homebrew
   end
 
   class TestCase < ::Minitest::Test
-    require "test/helper/env"
-    require "test/helper/shutup"
+    require "test/support/helper/env"
+    require "test/support/helper/shutup"
     include Test::Helper::Env
     include Test::Helper::Shutup
 
@@ -107,11 +106,11 @@ module Homebrew
     end
 
     def dylib_path(name)
-      Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.dylib")
+      Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.dylib")
     end
 
     def bundle_path(name)
-      Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle")
+      Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.bundle")
     end
 
     # Use a stubbed {Formulary::FormulaLoader} to make a given formula be found
-- 
GitLab