aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorAlyssa Ross2017-01-21 13:24:54 +0000
committerGitHub2017-01-21 13:24:54 +0000
commitab9d8df792bca8292e815ebc635094b0474a6a44 (patch)
tree32275fe167b961605ddeb2cf71fe1c1437d91c2a /Library/Homebrew/test
parentd7c463ad2c036bd9917398069217f6cad0f5b326 (diff)
parent70a381a00ff1e354e059aa07d55ebab90c5f874a (diff)
downloadbrew-ab9d8df792bca8292e815ebc635094b0474a6a44.tar.bz2
Merge pull request #1888 from alyssais/tests_enforce_lifecycle
tests: enforce `super` in lifecycle hooks
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/ARGV_test.rb1
-rw-r--r--Library/Homebrew/test/ENV_test.rb1
-rw-r--r--Library/Homebrew/test/audit_test.rb4
-rw-r--r--Library/Homebrew/test/bottle_collector_test.rb1
-rw-r--r--Library/Homebrew/test/bottle_hooks_test.rb2
-rw-r--r--Library/Homebrew/test/build_environment_test.rb1
-rw-r--r--Library/Homebrew/test/build_options_test.rb1
-rw-r--r--Library/Homebrew/test/caveats_test.rb1
-rw-r--r--Library/Homebrew/test/checksum_verification_test.rb1
-rw-r--r--Library/Homebrew/test/cleaner_test.rb2
-rw-r--r--Library/Homebrew/test/cleanup_test.rb2
-rw-r--r--Library/Homebrew/test/commands_test.rb2
-rw-r--r--Library/Homebrew/test/compiler_selector_test.rb1
-rw-r--r--Library/Homebrew/test/dependencies_test.rb2
-rw-r--r--Library/Homebrew/test/dependency_collector_test.rb2
-rw-r--r--Library/Homebrew/test/dependency_expansion_test.rb1
-rw-r--r--Library/Homebrew/test/dependency_test.rb1
-rw-r--r--Library/Homebrew/test/descriptions_test.rb3
-rw-r--r--Library/Homebrew/test/diagnostic_test.rb2
-rw-r--r--Library/Homebrew/test/download_strategies_test.rb6
-rw-r--r--Library/Homebrew/test/formula_lock_test.rb2
-rw-r--r--Library/Homebrew/test/formula_pin_test.rb2
-rw-r--r--Library/Homebrew/test/formula_test.rb5
-rw-r--r--Library/Homebrew/test/formulary_test.rb6
-rw-r--r--Library/Homebrew/test/gpg2_requirement_test.rb2
-rw-r--r--Library/Homebrew/test/gpg_test.rb1
-rw-r--r--Library/Homebrew/test/keg_test.rb4
-rw-r--r--Library/Homebrew/test/language_python_test.rb2
-rw-r--r--Library/Homebrew/test/migrator_test.rb5
-rw-r--r--Library/Homebrew/test/options_test.rb3
-rw-r--r--Library/Homebrew/test/os/mac/bottle_collector_test.rb1
-rw-r--r--Library/Homebrew/test/os/mac/dependency_collector_test.rb2
-rw-r--r--Library/Homebrew/test/os/mac/diagnostic_test.rb2
-rw-r--r--Library/Homebrew/test/os/mac/keg_test.rb4
-rw-r--r--Library/Homebrew/test/os/mac/mach_test.rb3
-rw-r--r--Library/Homebrew/test/os/mac/version_test.rb1
-rw-r--r--Library/Homebrew/test/patch_test.rb1
-rw-r--r--Library/Homebrew/test/patching_test.rb1
-rw-r--r--Library/Homebrew/test/pathname_test.rb2
-rw-r--r--Library/Homebrew/test/resource_test.rb1
-rw-r--r--Library/Homebrew/test/sandbox_test.rb2
-rw-r--r--Library/Homebrew/test/software_spec_test.rb3
-rw-r--r--Library/Homebrew/test/stdlib_test.rb1
-rw-r--r--Library/Homebrew/test/support/helper/integration_command_test_case.rb2
-rw-r--r--Library/Homebrew/test/support/helper/lifecycle_enforcer.rb22
-rw-r--r--Library/Homebrew/test/support/helper/test_case.rb2
-rw-r--r--Library/Homebrew/test/tab_test.rb4
-rw-r--r--Library/Homebrew/test/tap_test.rb3
-rw-r--r--Library/Homebrew/test/uninstall_test.rb3
-rw-r--r--Library/Homebrew/test/update_report_test.rb1
-rw-r--r--Library/Homebrew/test/utils_test.rb2
51 files changed, 132 insertions, 0 deletions
diff --git a/Library/Homebrew/test/ARGV_test.rb b/Library/Homebrew/test/ARGV_test.rb
index 6805e0c62..06660defc 100644
--- a/Library/Homebrew/test/ARGV_test.rb
+++ b/Library/Homebrew/test/ARGV_test.rb
@@ -3,6 +3,7 @@ require "extend/ARGV"
class ArgvExtensionTests < Homebrew::TestCase
def setup
+ super
@argv = [].extend(HomebrewArgvExtension)
end
diff --git a/Library/Homebrew/test/ENV_test.rb b/Library/Homebrew/test/ENV_test.rb
index dd6025084..cbfd01e25 100644
--- a/Library/Homebrew/test/ENV_test.rb
+++ b/Library/Homebrew/test/ENV_test.rb
@@ -31,6 +31,7 @@ end
module SharedEnvTests
def setup
+ super
@env = {}.extend(EnvActivation)
end
diff --git a/Library/Homebrew/test/audit_test.rb b/Library/Homebrew/test/audit_test.rb
index dace4dc2b..0b13d3c2b 100644
--- a/Library/Homebrew/test/audit_test.rb
+++ b/Library/Homebrew/test/audit_test.rb
@@ -6,11 +6,13 @@ require "dev-cmd/audit"
class FormulaTextTests < Homebrew::TestCase
def setup
+ super
@dir = mktmpdir
end
def teardown
FileUtils.rm_rf @dir
+ super
end
def formula_text(name, body = nil, options = {})
@@ -58,11 +60,13 @@ end
class FormulaAuditorTests < Homebrew::TestCase
def setup
+ super
@dir = mktmpdir
end
def teardown
FileUtils.rm_rf @dir
+ super
end
def formula_auditor(name, text, options = {})
diff --git a/Library/Homebrew/test/bottle_collector_test.rb b/Library/Homebrew/test/bottle_collector_test.rb
index d75e29ec8..5879da92c 100644
--- a/Library/Homebrew/test/bottle_collector_test.rb
+++ b/Library/Homebrew/test/bottle_collector_test.rb
@@ -3,6 +3,7 @@ require "utils/bottles"
class BottleCollectorTests < Homebrew::TestCase
def setup
+ super
@collector = Utils::Bottles::Collector.new
end
diff --git a/Library/Homebrew/test/bottle_hooks_test.rb b/Library/Homebrew/test/bottle_hooks_test.rb
index 3535d80ef..fd890192f 100644
--- a/Library/Homebrew/test/bottle_hooks_test.rb
+++ b/Library/Homebrew/test/bottle_hooks_test.rb
@@ -17,6 +17,7 @@ class BottleHookTests < Homebrew::TestCase
end
def setup
+ super
@fi = FormulaInstaller.new FormulaDouble.new
end
@@ -43,5 +44,6 @@ class BottleHookTests < Homebrew::TestCase
def teardown
Homebrew::Hooks::Bottles.reset_hooks
+ super
end
end
diff --git a/Library/Homebrew/test/build_environment_test.rb b/Library/Homebrew/test/build_environment_test.rb
index 73a1c95f7..54b9cb2b1 100644
--- a/Library/Homebrew/test/build_environment_test.rb
+++ b/Library/Homebrew/test/build_environment_test.rb
@@ -3,6 +3,7 @@ require "build_environment"
class BuildEnvironmentTests < Homebrew::TestCase
def setup
+ super
@env = BuildEnvironment.new
end
diff --git a/Library/Homebrew/test/build_options_test.rb b/Library/Homebrew/test/build_options_test.rb
index e460d25cc..05e7ccd94 100644
--- a/Library/Homebrew/test/build_options_test.rb
+++ b/Library/Homebrew/test/build_options_test.rb
@@ -4,6 +4,7 @@ require "options"
class BuildOptionsTests < Homebrew::TestCase
def setup
+ super
args = Options.create(%w[--with-foo --with-bar --without-qux])
opts = Options.create(%w[--with-foo --with-bar --without-baz --without-qux])
@build = BuildOptions.new(args, opts)
diff --git a/Library/Homebrew/test/caveats_test.rb b/Library/Homebrew/test/caveats_test.rb
index 9eaac5792..3a582b907 100644
--- a/Library/Homebrew/test/caveats_test.rb
+++ b/Library/Homebrew/test/caveats_test.rb
@@ -4,6 +4,7 @@ require "caveats"
class CaveatsTests < Homebrew::TestCase
def setup
+ super
@f = formula { url "foo-1.0" }
@c = Caveats.new @f
end
diff --git a/Library/Homebrew/test/checksum_verification_test.rb b/Library/Homebrew/test/checksum_verification_test.rb
index 9017b528d..ad7dfb462 100644
--- a/Library/Homebrew/test/checksum_verification_test.rb
+++ b/Library/Homebrew/test/checksum_verification_test.rb
@@ -19,6 +19,7 @@ class ChecksumVerificationTests < Homebrew::TestCase
def teardown
@_f.clear_cache
+ super
end
def test_good_sha256
diff --git a/Library/Homebrew/test/cleaner_test.rb b/Library/Homebrew/test/cleaner_test.rb
index ac108421c..413925dfa 100644
--- a/Library/Homebrew/test/cleaner_test.rb
+++ b/Library/Homebrew/test/cleaner_test.rb
@@ -6,12 +6,14 @@ class CleanerTests < Homebrew::TestCase
include FileUtils
def setup
+ super
@f = formula("cleaner_test") { url "foo-1.0" }
@f.prefix.mkpath
end
def teardown
@f.rack.rmtree if @f.rack.exist?
+ super
end
def test_clean_file
diff --git a/Library/Homebrew/test/cleanup_test.rb b/Library/Homebrew/test/cleanup_test.rb
index bb8e1cdc6..e27439e07 100644
--- a/Library/Homebrew/test/cleanup_test.rb
+++ b/Library/Homebrew/test/cleanup_test.rb
@@ -14,6 +14,7 @@ end
class CleanupTests < Homebrew::TestCase
def setup
+ super
@ds_store = Pathname.new "#{HOMEBREW_PREFIX}/Library/.DS_Store"
FileUtils.touch @ds_store
end
@@ -22,6 +23,7 @@ class CleanupTests < Homebrew::TestCase
FileUtils.rm_f @ds_store
ARGV.delete "--dry-run"
ARGV.delete "--prune=all"
+ super
end
def test_cleanup
diff --git a/Library/Homebrew/test/commands_test.rb b/Library/Homebrew/test/commands_test.rb
index d44d2da0e..3d7c16e58 100644
--- a/Library/Homebrew/test/commands_test.rb
+++ b/Library/Homebrew/test/commands_test.rb
@@ -13,6 +13,7 @@ end
class CommandsTests < Homebrew::TestCase
def setup
+ super
@cmds = [
# internal commands
HOMEBREW_LIBRARY_PATH/"cmd/rbcmd.rb",
@@ -28,6 +29,7 @@ class CommandsTests < Homebrew::TestCase
def teardown
@cmds.each(&:unlink)
+ super
end
def test_internal_commands
diff --git a/Library/Homebrew/test/compiler_selector_test.rb b/Library/Homebrew/test/compiler_selector_test.rb
index b1591bdbe..aa1a6f97e 100644
--- a/Library/Homebrew/test/compiler_selector_test.rb
+++ b/Library/Homebrew/test/compiler_selector_test.rb
@@ -31,6 +31,7 @@ class CompilerSelectorTests < Homebrew::TestCase
end
def setup
+ super
@f = Double.new
@cc = :clang
@versions = CompilerVersions.new
diff --git a/Library/Homebrew/test/dependencies_test.rb b/Library/Homebrew/test/dependencies_test.rb
index db3b78226..c5444fcbc 100644
--- a/Library/Homebrew/test/dependencies_test.rb
+++ b/Library/Homebrew/test/dependencies_test.rb
@@ -5,6 +5,7 @@ require "requirements"
class DependenciesTests < Homebrew::TestCase
def setup
+ super
@deps = Dependencies.new
end
@@ -89,6 +90,7 @@ end
class RequirementsTests < Homebrew::TestCase
def setup
+ super
@reqs = Requirements.new
end
diff --git a/Library/Homebrew/test/dependency_collector_test.rb b/Library/Homebrew/test/dependency_collector_test.rb
index 1c7f70118..c63d04637 100644
--- a/Library/Homebrew/test/dependency_collector_test.rb
+++ b/Library/Homebrew/test/dependency_collector_test.rb
@@ -11,11 +11,13 @@ class DependencyCollectorTests < Homebrew::TestCase
end
def setup
+ super
@d = DependencyCollector.new
end
def teardown
DependencyCollector.clear_cache
+ super
end
def test_dependency_creation
diff --git a/Library/Homebrew/test/dependency_expansion_test.rb b/Library/Homebrew/test/dependency_expansion_test.rb
index 9d6de35e2..de743ce03 100644
--- a/Library/Homebrew/test/dependency_expansion_test.rb
+++ b/Library/Homebrew/test/dependency_expansion_test.rb
@@ -9,6 +9,7 @@ class DependencyExpansionTests < Homebrew::TestCase
end
def setup
+ super
@foo = build_dep(:foo)
@bar = build_dep(:bar)
@baz = build_dep(:baz)
diff --git a/Library/Homebrew/test/dependency_test.rb b/Library/Homebrew/test/dependency_test.rb
index 134e91d13..404f26d79 100644
--- a/Library/Homebrew/test/dependency_test.rb
+++ b/Library/Homebrew/test/dependency_test.rb
@@ -3,6 +3,7 @@ require "dependency"
class DependableTests < Homebrew::TestCase
def setup
+ super
@tags = ["foo", "bar", :build]
@dep = Struct.new(:tags).new(@tags).extend(Dependable)
end
diff --git a/Library/Homebrew/test/descriptions_test.rb b/Library/Homebrew/test/descriptions_test.rb
index de38fdbd1..baeeb7b19 100644
--- a/Library/Homebrew/test/descriptions_test.rb
+++ b/Library/Homebrew/test/descriptions_test.rb
@@ -3,6 +3,8 @@ require "descriptions"
class DescriptionsTest < Homebrew::TestCase
def setup
+ super
+
@descriptions_hash = {}
@descriptions = Descriptions.new(@descriptions_hash)
@@ -12,6 +14,7 @@ class DescriptionsTest < Homebrew::TestCase
def teardown
$stdout = @old_stdout
+ super
end
def test_single_core_formula
diff --git a/Library/Homebrew/test/diagnostic_test.rb b/Library/Homebrew/test/diagnostic_test.rb
index c9bb524b0..608dda099 100644
--- a/Library/Homebrew/test/diagnostic_test.rb
+++ b/Library/Homebrew/test/diagnostic_test.rb
@@ -5,12 +5,14 @@ require "diagnostic"
class DiagnosticChecksTest < Homebrew::TestCase
def setup
+ super
@env = ENV.to_hash
@checks = Homebrew::Diagnostic::Checks.new
end
def teardown
ENV.replace(@env)
+ super
end
def test_inject_file_list
diff --git a/Library/Homebrew/test/download_strategies_test.rb b/Library/Homebrew/test/download_strategies_test.rb
index 2b64abbf9..fa69ec64e 100644
--- a/Library/Homebrew/test/download_strategies_test.rb
+++ b/Library/Homebrew/test/download_strategies_test.rb
@@ -15,6 +15,7 @@ class AbstractDownloadStrategyTests < Homebrew::TestCase
include FileUtils
def setup
+ super
@name = "foo"
@resource = ResourceDouble.new
@strategy = AbstractDownloadStrategy.new(@name, @resource)
@@ -63,6 +64,7 @@ end
class GitHubPrivateRepositoryDownloadStrategyTests < Homebrew::TestCase
def setup
+ super
resource = ResourceDouble.new("https://github.com/owner/repo/archive/1.1.5.tar.gz")
ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
GitHub.stubs(:repository).returns {}
@@ -87,6 +89,7 @@ end
class GitHubPrivateRepositoryReleaseDownloadStrategyTests < Homebrew::TestCase
def setup
+ super
resource = ResourceDouble.new("https://github.com/owner/repo/releases/download/tag/foo_v0.1.0_darwin_amd64.tar.gz")
ENV["HOMEBREW_GITHUB_API_TOKEN"] = "token"
GitHub.stubs(:repository).returns {}
@@ -138,6 +141,7 @@ class GitDownloadStrategyTests < Homebrew::TestCase
include FileUtils
def setup
+ super
resource = ResourceDouble.new("https://github.com/homebrew/foo")
@commit_id = 1
@strategy = GitDownloadStrategy.new("baz", resource)
@@ -147,6 +151,7 @@ class GitDownloadStrategyTests < Homebrew::TestCase
def teardown
rmtree @cached_location
+ super
end
def git_commit_all
@@ -236,6 +241,7 @@ end
class DownloadStrategyDetectorTests < Homebrew::TestCase
def setup
+ super
@d = DownloadStrategyDetector.new
end
diff --git a/Library/Homebrew/test/formula_lock_test.rb b/Library/Homebrew/test/formula_lock_test.rb
index 80ee9dd25..d5bd0d07c 100644
--- a/Library/Homebrew/test/formula_lock_test.rb
+++ b/Library/Homebrew/test/formula_lock_test.rb
@@ -3,6 +3,7 @@ require "formula_lock"
class FormulaLockTests < Homebrew::TestCase
def setup
+ super
@lock = FormulaLock.new("foo")
@lock.lock
end
@@ -10,6 +11,7 @@ class FormulaLockTests < Homebrew::TestCase
def teardown
@lock.unlock
HOMEBREW_LOCK_DIR.children.each(&:unlink)
+ super
end
def test_locking_file_with_existing_lock_raises_error
diff --git a/Library/Homebrew/test/formula_pin_test.rb b/Library/Homebrew/test/formula_pin_test.rb
index 297d7703e..5dd2bd29e 100644
--- a/Library/Homebrew/test/formula_pin_test.rb
+++ b/Library/Homebrew/test/formula_pin_test.rb
@@ -21,6 +21,7 @@ class FormulaPinTests < Homebrew::TestCase
end
def setup
+ super
@f = FormulaDouble.new
@pin = FormulaPin.new(@f)
@f.rack.mkpath
@@ -50,5 +51,6 @@ class FormulaPinTests < Homebrew::TestCase
def teardown
@f.rack.rmtree
+ super
end
end
diff --git a/Library/Homebrew/test/formula_test.rb b/Library/Homebrew/test/formula_test.rb
index 2d2136a05..8293768fe 100644
--- a/Library/Homebrew/test/formula_test.rb
+++ b/Library/Homebrew/test/formula_test.rb
@@ -874,6 +874,8 @@ class AliasChangeTests < Homebrew::TestCase
end
def setup
+ super
+
alias_name = "bar"
@alias_path = "#{CoreTap.instance.alias_dir}/#{alias_name}"
@@ -942,6 +944,8 @@ class OutdatedVersionsTests < Homebrew::TestCase
attr_reader :f, :old_formula, :new_formula
def setup
+ super
+
@f = formula do
url "foo"
version "1.20"
@@ -960,6 +964,7 @@ class OutdatedVersionsTests < Homebrew::TestCase
def teardown
formulae = [@f, @old_formula, @new_formula]
formulae.map(&:rack).select(&:exist?).each(&:rmtree)
+ super
end
def alias_path
diff --git a/Library/Homebrew/test/formulary_test.rb b/Library/Homebrew/test/formulary_test.rb
index a306c43df..360c44a0d 100644
--- a/Library/Homebrew/test/formulary_test.rb
+++ b/Library/Homebrew/test/formulary_test.rb
@@ -16,6 +16,7 @@ end
class FormularyFactoryTest < Homebrew::TestCase
def setup
+ super
@name = "testball_bottle"
@path = CoreTap.new.formula_dir/"#{@name}.rb"
@bottle_dir = Pathname.new("#{TEST_FIXTURE_DIR}/bottles")
@@ -41,6 +42,7 @@ class FormularyFactoryTest < Homebrew::TestCase
def teardown
@path.unlink
+ super
end
def test_factory
@@ -129,6 +131,7 @@ end
class FormularyTapFactoryTest < Homebrew::TestCase
def setup
+ super
@name = "foo"
@tap = Tap.new "homebrew", "foo"
@path = @tap.path/"#{@name}.rb"
@@ -142,6 +145,7 @@ class FormularyTapFactoryTest < Homebrew::TestCase
def teardown
@tap.path.rmtree
+ super
end
def test_factory_tap_formula
@@ -174,6 +178,7 @@ end
class FormularyTapPriorityTest < Homebrew::TestCase
def setup
+ super
@name = "foo"
@core_path = CoreTap.new.formula_dir/"#{@name}.rb"
@tap = Tap.new "homebrew", "foo"
@@ -190,6 +195,7 @@ class FormularyTapPriorityTest < Homebrew::TestCase
def teardown
@core_path.unlink
@tap.path.rmtree
+ super
end
def test_find_with_priority_core_formula
diff --git a/Library/Homebrew/test/gpg2_requirement_test.rb b/Library/Homebrew/test/gpg2_requirement_test.rb
index fa7fc9ea4..b45798b42 100644
--- a/Library/Homebrew/test/gpg2_requirement_test.rb
+++ b/Library/Homebrew/test/gpg2_requirement_test.rb
@@ -4,6 +4,7 @@ require "fileutils"
class GPG2RequirementTests < Homebrew::TestCase
def setup
+ super
@dir = Pathname.new(mktmpdir)
(@dir/"bin/gpg").write <<-EOS.undent
#!/bin/bash
@@ -14,6 +15,7 @@ class GPG2RequirementTests < Homebrew::TestCase
def teardown
FileUtils.rm_rf @dir
+ super
end
def test_satisfied
diff --git a/Library/Homebrew/test/gpg_test.rb b/Library/Homebrew/test/gpg_test.rb
index 0374bdab4..881468ad2 100644
--- a/Library/Homebrew/test/gpg_test.rb
+++ b/Library/Homebrew/test/gpg_test.rb
@@ -3,6 +3,7 @@ require "gpg"
class GpgTest < Homebrew::TestCase
def setup
+ super
skip "GPG Unavailable" unless Gpg.available?
@dir = Pathname.new(mktmpdir)
end
diff --git a/Library/Homebrew/test/keg_test.rb b/Library/Homebrew/test/keg_test.rb
index 40b47b5e9..08bda4699 100644
--- a/Library/Homebrew/test/keg_test.rb
+++ b/Library/Homebrew/test/keg_test.rb
@@ -20,6 +20,8 @@ class LinkTestCase < Homebrew::TestCase
end
def setup
+ super
+
@keg = setup_test_keg("foo", "1.0")
@dst = HOMEBREW_PREFIX.join("bin", "helloworld")
@nonexistent = Pathname.new("/some/nonexistent/path")
@@ -43,6 +45,8 @@ class LinkTestCase < Homebrew::TestCase
rmtree HOMEBREW_PREFIX/"bin"
rmtree HOMEBREW_PREFIX/"lib"
+
+ super
end
end
diff --git a/Library/Homebrew/test/language_python_test.rb b/Library/Homebrew/test/language_python_test.rb
index d1e3867f7..0a6d1eeaa 100644
--- a/Library/Homebrew/test/language_python_test.rb
+++ b/Library/Homebrew/test/language_python_test.rb
@@ -4,6 +4,7 @@ require "resource"
class LanguagePythonTests < Homebrew::TestCase
def setup
+ super
@dir = Pathname.new(mktmpdir)
resource = stub("resource", stage: true)
formula_bin = @dir/"formula_bin"
@@ -16,6 +17,7 @@ class LanguagePythonTests < Homebrew::TestCase
def teardown
FileUtils.rm_rf @dir
+ super
end
def test_virtualenv_creation
diff --git a/Library/Homebrew/test/migrator_test.rb b/Library/Homebrew/test/migrator_test.rb
index 8a2b6ad63..53151f3e3 100644
--- a/Library/Homebrew/test/migrator_test.rb
+++ b/Library/Homebrew/test/migrator_test.rb
@@ -10,6 +10,7 @@ end
class MigratorErrorsTests < Homebrew::TestCase
def setup
+ super
@new_f = Testball.new("newname")
@new_f.oldname = "oldname"
@old_f = Testball.new("oldname")
@@ -40,6 +41,8 @@ class MigratorTests < Homebrew::TestCase
include FileUtils
def setup
+ super
+
@new_f = Testball.new("newname")
@new_f.oldname = "oldname"
@@ -93,6 +96,8 @@ class MigratorTests < Homebrew::TestCase
@new_f.unpin
HOMEBREW_LOCK_DIR.children.each(&:unlink)
+
+ super
end
def test_move_cellar
diff --git a/Library/Homebrew/test/options_test.rb b/Library/Homebrew/test/options_test.rb
index e7189a604..f38ec4415 100644
--- a/Library/Homebrew/test/options_test.rb
+++ b/Library/Homebrew/test/options_test.rb
@@ -15,6 +15,7 @@ end
class OptionTests < Homebrew::TestCase
def setup
+ super
@option = Option.new("foo")
end
@@ -43,6 +44,7 @@ end
class DeprecatedOptionTests < Homebrew::TestCase
def setup
+ super
@deprecated_option = DeprecatedOption.new("foo", "bar")
end
@@ -68,6 +70,7 @@ end
class OptionsTests < Homebrew::TestCase
def setup
+ super
@options = Options.new
end
diff --git a/Library/Homebrew/test/os/mac/bottle_collector_test.rb b/Library/Homebrew/test/os/mac/bottle_collector_test.rb
index 2f88050ae..e9ae9b753 100644
--- a/Library/Homebrew/test/os/mac/bottle_collector_test.rb
+++ b/Library/Homebrew/test/os/mac/bottle_collector_test.rb
@@ -3,6 +3,7 @@ require "utils/bottles"
class OSMacBottleCollectorTests < Homebrew::TestCase
def setup
+ super
@collector = Utils::Bottles::Collector.new
end
diff --git a/Library/Homebrew/test/os/mac/dependency_collector_test.rb b/Library/Homebrew/test/os/mac/dependency_collector_test.rb
index 4fdf3ebe4..1033df9ab 100644
--- a/Library/Homebrew/test/os/mac/dependency_collector_test.rb
+++ b/Library/Homebrew/test/os/mac/dependency_collector_test.rb
@@ -7,11 +7,13 @@ class OSMacDependencyCollectorTests < Homebrew::TestCase
end
def setup
+ super
@d = DependencyCollector.new
end
def teardown
DependencyCollector.clear_cache
+ super
end
def test_tar_needs_xz_dependency
diff --git a/Library/Homebrew/test/os/mac/diagnostic_test.rb b/Library/Homebrew/test/os/mac/diagnostic_test.rb
index 655aa1d46..284d293ca 100644
--- a/Library/Homebrew/test/os/mac/diagnostic_test.rb
+++ b/Library/Homebrew/test/os/mac/diagnostic_test.rb
@@ -5,12 +5,14 @@ require "diagnostic"
class OSMacDiagnosticChecksTest < Homebrew::TestCase
def setup
+ super
@env = ENV.to_hash
@checks = Homebrew::Diagnostic::Checks.new
end
def teardown
ENV.replace(@env)
+ super
end
def test_check_for_other_package_managers
diff --git a/Library/Homebrew/test/os/mac/keg_test.rb b/Library/Homebrew/test/os/mac/keg_test.rb
index e79cbc921..5f215bd06 100644
--- a/Library/Homebrew/test/os/mac/keg_test.rb
+++ b/Library/Homebrew/test/os/mac/keg_test.rb
@@ -6,6 +6,8 @@ class OSMacLinkTests < Homebrew::TestCase
include FileUtils
def setup
+ super
+
keg = HOMEBREW_CELLAR.join("foo", "1.0")
keg.join("bin").mkpath
@@ -34,6 +36,8 @@ class OSMacLinkTests < Homebrew::TestCase
rmtree HOMEBREW_PREFIX/"bin"
rmtree HOMEBREW_PREFIX/"lib"
+
+ super
end
def test_mach_o_files_skips_hardlinks
diff --git a/Library/Homebrew/test/os/mac/mach_test.rb b/Library/Homebrew/test/os/mac/mach_test.rb
index a42f7316b..ed0424be6 100644
--- a/Library/Homebrew/test/os/mac/mach_test.rb
+++ b/Library/Homebrew/test/os/mac/mach_test.rb
@@ -109,6 +109,7 @@ end
class ArchitectureListExtensionTests < MachOPathnameTests
def setup
+ super
@archs = [:i386, :x86_64, :ppc7400, :ppc64].extend(ArchitectureListExtension)
end
@@ -157,11 +158,13 @@ class TextExecutableTests < Homebrew::TestCase
attr_reader :pn
def setup
+ super
@pn = HOMEBREW_PREFIX.join("an_executable")
end
def teardown
HOMEBREW_PREFIX.join("an_executable").unlink
+ super
end
def test_simple_shebang
diff --git a/Library/Homebrew/test/os/mac/version_test.rb b/Library/Homebrew/test/os/mac/version_test.rb
index f702c7097..ba4217691 100644
--- a/Library/Homebrew/test/os/mac/version_test.rb
+++ b/Library/Homebrew/test/os/mac/version_test.rb
@@ -4,6 +4,7 @@ require "os/mac/version"
class OSMacVersionTests < Homebrew::TestCase
def setup
+ super
@v = MacOS::Version.new("10.7")
end
diff --git a/Library/Homebrew/test/patch_test.rb b/Library/Homebrew/test/patch_test.rb
index 62624720e..f5a61398a 100644
--- a/Library/Homebrew/test/patch_test.rb
+++ b/Library/Homebrew/test/patch_test.rb
@@ -111,6 +111,7 @@ end
class ExternalPatchTests < Homebrew::TestCase
def setup
+ super
@p = ExternalPatch.new(:p1) { url "file:///my.patch" }
end
diff --git a/Library/Homebrew/test/patching_test.rb b/Library/Homebrew/test/patching_test.rb
index ac14c8e1e..eadab15dc 100644
--- a/Library/Homebrew/test/patching_test.rb
+++ b/Library/Homebrew/test/patching_test.rb
@@ -23,6 +23,7 @@ class PatchingTests < Homebrew::TestCase
def teardown
@_f.clear_cache
@_f.patchlist.each { |p| p.clear_cache if p.external? }
+ super
end
def assert_patched(formula)
diff --git a/Library/Homebrew/test/pathname_test.rb b/Library/Homebrew/test/pathname_test.rb
index 2f6360719..2f4002b00 100644
--- a/Library/Homebrew/test/pathname_test.rb
+++ b/Library/Homebrew/test/pathname_test.rb
@@ -7,6 +7,7 @@ module PathnameTestExtension
include FileUtils
def setup
+ super
@src = Pathname.new(mktmpdir)
@dst = Pathname.new(mktmpdir)
@file = @src/"foo"
@@ -16,6 +17,7 @@ module PathnameTestExtension
def teardown
rmtree(@src)
rmtree(@dst)
+ super
end
end
diff --git a/Library/Homebrew/test/resource_test.rb b/Library/Homebrew/test/resource_test.rb
index c1b526cb2..d982a7c33 100644
--- a/Library/Homebrew/test/resource_test.rb
+++ b/Library/Homebrew/test/resource_test.rb
@@ -3,6 +3,7 @@ require "resource"
class ResourceTests < Homebrew::TestCase
def setup
+ super
@resource = Resource.new("test")
end
diff --git a/Library/Homebrew/test/sandbox_test.rb b/Library/Homebrew/test/sandbox_test.rb
index 2a062cb10..96558afa4 100644
--- a/Library/Homebrew/test/sandbox_test.rb
+++ b/Library/Homebrew/test/sandbox_test.rb
@@ -3,6 +3,7 @@ require "sandbox"
class SandboxTest < Homebrew::TestCase
def setup
+ super
skip "sandbox not implemented" unless Sandbox.available?
@sandbox = Sandbox.new
@dir = Pathname.new(mktmpdir)
@@ -11,6 +12,7 @@ class SandboxTest < Homebrew::TestCase
def teardown
@dir.rmtree
+ super
end
def test_formula?
diff --git a/Library/Homebrew/test/software_spec_test.rb b/Library/Homebrew/test/software_spec_test.rb
index d9226f8c3..026265a4a 100644
--- a/Library/Homebrew/test/software_spec_test.rb
+++ b/Library/Homebrew/test/software_spec_test.rb
@@ -3,6 +3,7 @@ require "software_spec"
class SoftwareSpecTests < Homebrew::TestCase
def setup
+ super
@spec = SoftwareSpec.new
end
@@ -136,6 +137,7 @@ end
class HeadSoftwareSpecTests < Homebrew::TestCase
def setup
+ super
@spec = HeadSoftwareSpec.new
end
@@ -150,6 +152,7 @@ end
class BottleSpecificationTests < Homebrew::TestCase
def setup
+ super
@spec = BottleSpecification.new
end
diff --git a/Library/Homebrew/test/stdlib_test.rb b/Library/Homebrew/test/stdlib_test.rb
index 3babfd58a..f193ae71e 100644
--- a/Library/Homebrew/test/stdlib_test.rb
+++ b/Library/Homebrew/test/stdlib_test.rb
@@ -4,6 +4,7 @@ require "cxxstdlib"
class CxxStdlibTests < Homebrew::TestCase
def setup
+ super
@clang = CxxStdlib.create(:libstdcxx, :clang)
@gcc = CxxStdlib.create(:libstdcxx, :gcc)
@gcc40 = CxxStdlib.create(:libstdcxx, :gcc_4_0)
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 6879f2f81..86184ac51 100644
--- a/Library/Homebrew/test/support/helper/integration_command_test_case.rb
+++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb
@@ -6,6 +6,7 @@ require "test/support/helper/test_case"
class IntegrationCommandTestCase < Homebrew::TestCase
def setup
+ super
@cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`.
(HOMEBREW_PREFIX/"bin").mkpath
FileUtils.touch HOMEBREW_PREFIX/"bin/brew"
@@ -38,6 +39,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
coretap.path/"formula_renames.json",
].flatten
FileUtils.rm_rf paths_to_delete
+ super
end
def needs_test_cmd_taps
diff --git a/Library/Homebrew/test/support/helper/lifecycle_enforcer.rb b/Library/Homebrew/test/support/helper/lifecycle_enforcer.rb
new file mode 100644
index 000000000..413f8b11e
--- /dev/null
+++ b/Library/Homebrew/test/support/helper/lifecycle_enforcer.rb
@@ -0,0 +1,22 @@
+module Test
+ module Helper
+ module LifecycleEnforcer
+ def setup
+ @__setup_called = true
+ super
+ end
+
+ def teardown
+ @__teardown_called = true
+ super
+ end
+
+ def after_teardown
+ assert @__setup_called, "Expected setup to call `super` but didn't"
+ assert @__teardown_called, "Expected teardown to call `super` but didn't"
+
+ super
+ end
+ end
+ end
+end
diff --git a/Library/Homebrew/test/support/helper/test_case.rb b/Library/Homebrew/test/support/helper/test_case.rb
index 60c91e7bb..5becfeef1 100644
--- a/Library/Homebrew/test/support/helper/test_case.rb
+++ b/Library/Homebrew/test/support/helper/test_case.rb
@@ -2,10 +2,12 @@ module Homebrew
class TestCase < ::Minitest::Test
require "test/support/helper/env"
require "test/support/helper/fs_leak_logger"
+ require "test/support/helper/lifecycle_enforcer"
require "test/support/helper/shutup"
require "test/support/helper/version_assertions"
include Test::Helper::Env
include Test::Helper::FSLeakLogger
+ include Test::Helper::LifecycleEnforcer
include Test::Helper::Shutup
include Test::Helper::VersionAssertions
diff --git a/Library/Homebrew/test/tab_test.rb b/Library/Homebrew/test/tab_test.rb
index f9824ba2a..5a354a908 100644
--- a/Library/Homebrew/test/tab_test.rb
+++ b/Library/Homebrew/test/tab_test.rb
@@ -4,6 +4,8 @@ require "formula"
class TabTests < Homebrew::TestCase
def setup
+ super
+
@used = Options.create(%w[--with-foo --without-bar])
@unused = Options.create(%w[--with-baz --without-qux])
@@ -260,6 +262,7 @@ end
class TabLoadingTests < Homebrew::TestCase
def setup
+ super
@f = formula { url "foo-1.0" }
@f.prefix.mkpath
@path = @f.prefix.join(Tab::FILENAME)
@@ -268,6 +271,7 @@ class TabLoadingTests < Homebrew::TestCase
def teardown
@f.rack.rmtree
+ super
end
def test_for_keg
diff --git a/Library/Homebrew/test/tap_test.rb b/Library/Homebrew/test/tap_test.rb
index 7114cdf22..4990bc6df 100644
--- a/Library/Homebrew/test/tap_test.rb
+++ b/Library/Homebrew/test/tap_test.rb
@@ -34,6 +34,7 @@ class TapTest < Homebrew::TestCase
include FileUtils
def setup
+ super
@path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo"
@path.mkpath
@tap = Tap.new("Homebrew", "foo")
@@ -86,6 +87,7 @@ class TapTest < Homebrew::TestCase
def teardown
@path.rmtree
+ super
end
def test_fetch
@@ -285,6 +287,7 @@ class CoreTapTest < Homebrew::TestCase
include FileUtils
def setup
+ super
@repo = CoreTap.new
end
diff --git a/Library/Homebrew/test/uninstall_test.rb b/Library/Homebrew/test/uninstall_test.rb
index 597e77e40..4ab2f985e 100644
--- a/Library/Homebrew/test/uninstall_test.rb
+++ b/Library/Homebrew/test/uninstall_test.rb
@@ -3,6 +3,8 @@ require "cmd/uninstall"
class UninstallTests < Homebrew::TestCase
def setup
+ super
+
@dependency = formula("dependency") { url "f-1" }
@dependent = formula("dependent") do
url "f-1"
@@ -32,6 +34,7 @@ class UninstallTests < Homebrew::TestCase
f.installed_kegs.each(&:remove_opt_record)
f.rack.rmtree
end
+ super
end
def handle_unsatisfied_dependents
diff --git a/Library/Homebrew/test/update_report_test.rb b/Library/Homebrew/test/update_report_test.rb
index 6b6cec6ce..32c3e36d0 100644
--- a/Library/Homebrew/test/update_report_test.rb
+++ b/Library/Homebrew/test/update_report_test.rb
@@ -24,6 +24,7 @@ class ReportTests < Homebrew::TestCase
end
def setup
+ super
@tap = CoreTap.new
@reporter = ReporterMock.new(@tap)
@hub = ReporterHub.new
diff --git a/Library/Homebrew/test/utils_test.rb b/Library/Homebrew/test/utils_test.rb
index d7c25683d..310bfb135 100644
--- a/Library/Homebrew/test/utils_test.rb
+++ b/Library/Homebrew/test/utils_test.rb
@@ -5,6 +5,7 @@ require "utils/shell"
class UtilTests < Homebrew::TestCase
def setup
+ super
@dir = Pathname.new(mktmpdir)
@env = ENV.to_hash
end
@@ -12,6 +13,7 @@ class UtilTests < Homebrew::TestCase
def teardown
@dir.rmtree
ENV.replace @env
+ super
end
def test_ofail