diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml index 867a61966f..3705170fdc 100644 --- a/Library/Homebrew/.rubocop_todo.yml +++ b/Library/Homebrew/.rubocop_todo.yml @@ -21,7 +21,7 @@ Lint/HandleExceptions: - 'extend/pathname.rb' - 'formula.rb' - 'formula_versions.rb' - - 'test/test_ENV.rb' + - 'test/ENV_test.rb' # Offense count: 3 Lint/IneffectiveAccessModifier: @@ -51,7 +51,7 @@ Lint/RescueException: - 'postinstall.rb' - 'readall.rb' - 'test.rb' - - 'test/test_ENV.rb' + - 'test/ENV_test.rb' - 'utils/fork.rb' # Offense count: 1 @@ -90,7 +90,7 @@ Style/ClassVars: Exclude: - 'dev-cmd/audit.rb' - 'formula_installer.rb' - - 'test/testing_env.rb' + - 'test/support/helper/fs_leak_logger.rb' # Offense count: 13 # Configuration parameters: AllowedVariables. @@ -114,7 +114,7 @@ Style/MultilineBlockChain: - 'dev-cmd/audit.rb' - 'dev-cmd/man.rb' - 'diagnostic.rb' - - 'test/test_patching.rb' + - 'test/patching_test.rb' # Offense count: 4 # Cop supports --auto-correct. 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/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index c7461fc5ab..df3b5fafe7 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -761,7 +761,7 @@ class FormulaAuditor bin_names.each do |name| ["system", "shell_output", "pipe_output"].each do |cmd| if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{Regexp.escape name}[\s'"]/m - problem %(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}") + problem %Q(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}") end end end diff --git a/Library/Homebrew/dev-cmd/tests.rb b/Library/Homebrew/dev-cmd/tests.rb index ee7fa92757..c032b34372 100644 --- a/Library/Homebrew/dev-cmd/tests.rb +++ b/Library/Homebrew/dev-cmd/tests.rb @@ -8,7 +8,7 @@ module Homebrew module_function def tests - (HOMEBREW_LIBRARY/"Homebrew").cd do + HOMEBREW_LIBRARY_PATH.cd do ENV.delete "HOMEBREW_VERBOSE" ENV.delete "VERBOSE" ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" @@ -44,8 +44,8 @@ module Homebrew # Make it easier to reproduce test runs. ENV["SEED"] = ARGV.next if ARGV.include? "--seed" - files = Dir["test/test_*.rb"] - files -= Dir["test/test_os_mac_*.rb"] unless OS.mac? + files = Dir.glob("test/**/*_test.rb") + .reject { |p| !OS.mac? && p.start_with?("test/os/mac/") } opts = [] opts << "--serialize-stdout" if ENV["CI"] @@ -54,20 +54,18 @@ module Homebrew args << "--trace" if ARGV.include? "--trace" if ARGV.value("only") - ENV["HOMEBREW_TESTS_ONLY"] = "1" - test_name, test_method = ARGV.value("only").split("/", 2) - files = ["test/test_#{test_name}.rb"] + test_name, test_method = ARGV.value("only").split(":", 2) + files = Dir.glob("test/{#{test_name},#{test_name}/**/*}_test.rb") args << "--name=test_#{test_method}" if test_method end args += ARGV.named.select { |v| v[/^TEST(OPTS)?=/] } - system "bundle", "exec", "parallel_test", *opts, - "--", *args, "--", *files + system "bundle", "exec", "parallel_test", *opts, "--", *args, "--", *files Homebrew.failed = !$?.success? - if (fs_leak_log = HOMEBREW_LIBRARY/"Homebrew/test/fs_leak_log").file? + if (fs_leak_log = HOMEBREW_LIBRARY_PATH/"tmp/fs_leak.log").file? fs_leak_log_content = fs_leak_log.read unless fs_leak_log_content.empty? opoo "File leak is detected" diff --git a/Library/Homebrew/test/test_ARGV.rb b/Library/Homebrew/test/ARGV_test.rb similarity index 100% rename from Library/Homebrew/test/test_ARGV.rb rename to Library/Homebrew/test/ARGV_test.rb diff --git a/Library/Homebrew/test/test_ENV.rb b/Library/Homebrew/test/ENV_test.rb similarity index 99% rename from Library/Homebrew/test/test_ENV.rb rename to Library/Homebrew/test/ENV_test.rb index e38c75c6e4..6c0e68a9e3 100644 --- a/Library/Homebrew/test/test_ENV.rb +++ b/Library/Homebrew/test/ENV_test.rb @@ -1,6 +1,6 @@ require "testing_env" require "extend/ENV" -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestEnv < IntegrationCommandTestCase def test_env diff --git a/Library/Homebrew/test/test_analytics.rb b/Library/Homebrew/test/analytics_test.rb similarity index 94% rename from Library/Homebrew/test/test_analytics.rb rename to Library/Homebrew/test/analytics_test.rb index 00e0593db4..37040f3cd8 100644 --- a/Library/Homebrew/test/test_analytics.rb +++ b/Library/Homebrew/test/analytics_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestAnalytics < IntegrationCommandTestCase def test_analytics diff --git a/Library/Homebrew/test/test_audit.rb b/Library/Homebrew/test/audit_test.rb similarity index 100% rename from Library/Homebrew/test/test_audit.rb rename to Library/Homebrew/test/audit_test.rb diff --git a/Library/Homebrew/test/test_bash.rb b/Library/Homebrew/test/bash_test.rb similarity index 100% rename from Library/Homebrew/test/test_bash.rb rename to Library/Homebrew/test/bash_test.rb diff --git a/Library/Homebrew/test/test_blacklist.rb b/Library/Homebrew/test/blacklist_test.rb similarity index 100% rename from Library/Homebrew/test/test_blacklist.rb rename to Library/Homebrew/test/blacklist_test.rb diff --git a/Library/Homebrew/test/test_bottle_collector.rb b/Library/Homebrew/test/bottle_collector_test.rb similarity index 100% rename from Library/Homebrew/test/test_bottle_collector.rb rename to Library/Homebrew/test/bottle_collector_test.rb diff --git a/Library/Homebrew/test/test_bottle_filename.rb b/Library/Homebrew/test/bottle_filename_test.rb similarity index 100% rename from Library/Homebrew/test/test_bottle_filename.rb rename to Library/Homebrew/test/bottle_filename_test.rb diff --git a/Library/Homebrew/test/test_bottle_hooks.rb b/Library/Homebrew/test/bottle_hooks_test.rb similarity index 100% rename from Library/Homebrew/test/test_bottle_hooks.rb rename to Library/Homebrew/test/bottle_hooks_test.rb diff --git a/Library/Homebrew/test/test_bottle.rb b/Library/Homebrew/test/bottle_test.rb similarity index 93% rename from Library/Homebrew/test/test_bottle.rb rename to Library/Homebrew/test/bottle_test.rb index 48727cfd90..c10746e098 100644 --- a/Library/Homebrew/test/test_bottle.rb +++ b/Library/Homebrew/test/bottle_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestBottle < IntegrationCommandTestCase def test_bottle diff --git a/Library/Homebrew/test/test_build_environment.rb b/Library/Homebrew/test/build_environment_test.rb similarity index 100% rename from Library/Homebrew/test/test_build_environment.rb rename to Library/Homebrew/test/build_environment_test.rb diff --git a/Library/Homebrew/test/test_build_options.rb b/Library/Homebrew/test/build_options_test.rb similarity index 100% rename from Library/Homebrew/test/test_build_options.rb rename to Library/Homebrew/test/build_options_test.rb diff --git a/Library/Homebrew/test/test_bundle.rb b/Library/Homebrew/test/bundle_test.rb similarity index 91% rename from Library/Homebrew/test/test_bundle.rb rename to Library/Homebrew/test/bundle_test.rb index 6b040df1db..ae47977d84 100644 --- a/Library/Homebrew/test/test_bundle.rb +++ b/Library/Homebrew/test/bundle_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestBundle < IntegrationCommandTestCase def test_bundle diff --git a/Library/Homebrew/test/test_cache_formula.rb b/Library/Homebrew/test/cache_formula_test.rb similarity index 80% rename from Library/Homebrew/test/test_cache_formula.rb rename to Library/Homebrew/test/cache_formula_test.rb index f4e37e2a2e..6dcb6a745a 100644 --- a/Library/Homebrew/test/test_cache_formula.rb +++ b/Library/Homebrew/test/cache_formula_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase def test_cache_formula diff --git a/Library/Homebrew/test/test_cache.rb b/Library/Homebrew/test/cache_test.rb similarity index 77% rename from Library/Homebrew/test/test_cache.rb rename to Library/Homebrew/test/cache_test.rb index cd7a5e2fab..3a9e6b0111 100644 --- a/Library/Homebrew/test/test_cache.rb +++ b/Library/Homebrew/test/cache_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCache < IntegrationCommandTestCase def test_cache diff --git a/Library/Homebrew/test/test_cask.rb b/Library/Homebrew/test/cask_test.rb similarity index 83% rename from Library/Homebrew/test/test_cask.rb rename to Library/Homebrew/test/cask_test.rb index 6cae6d54ba..d5b81facb6 100644 --- a/Library/Homebrew/test/test_cask.rb +++ b/Library/Homebrew/test/cask_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCask < IntegrationCommandTestCase def test_cask diff --git a/Library/Homebrew/test/test_cat.rb b/Library/Homebrew/test/cat_test.rb similarity index 81% rename from Library/Homebrew/test/test_cat.rb rename to Library/Homebrew/test/cat_test.rb index 4cfd19c3dc..bb37b5fdec 100644 --- a/Library/Homebrew/test/test_cat.rb +++ b/Library/Homebrew/test/cat_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCat < IntegrationCommandTestCase def test_cat diff --git a/Library/Homebrew/test/test_caveats.rb b/Library/Homebrew/test/caveats_test.rb similarity index 100% rename from Library/Homebrew/test/test_caveats.rb rename to Library/Homebrew/test/caveats_test.rb diff --git a/Library/Homebrew/test/test_cellar_formula.rb b/Library/Homebrew/test/cellar_formula_test.rb similarity index 80% rename from Library/Homebrew/test/test_cellar_formula.rb rename to Library/Homebrew/test/cellar_formula_test.rb index 7c458be9d0..38a934a7ba 100644 --- a/Library/Homebrew/test/test_cellar_formula.rb +++ b/Library/Homebrew/test/cellar_formula_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase def test_cellar_formula diff --git a/Library/Homebrew/test/test_cellar.rb b/Library/Homebrew/test/cellar_test.rb similarity index 77% rename from Library/Homebrew/test/test_cellar.rb rename to Library/Homebrew/test/cellar_test.rb index b793c53424..74d5389f81 100644 --- a/Library/Homebrew/test/test_cellar.rb +++ b/Library/Homebrew/test/cellar_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCellar < IntegrationCommandTestCase def test_cellar diff --git a/Library/Homebrew/test/test_checksum.rb b/Library/Homebrew/test/checksum_test.rb similarity index 100% rename from Library/Homebrew/test/test_checksum.rb rename to Library/Homebrew/test/checksum_test.rb diff --git a/Library/Homebrew/test/test_checksum_verification.rb b/Library/Homebrew/test/checksum_verification_test.rb similarity index 91% rename from Library/Homebrew/test/test_checksum_verification.rb rename to Library/Homebrew/test/checksum_verification_test.rb index e25d08b833..9017b528d0 100644 --- a/Library/Homebrew/test/test_checksum_verification.rb +++ b/Library/Homebrew/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.rb b/Library/Homebrew/test/cleaner_test.rb similarity index 97% rename from Library/Homebrew/test/test_cleaner.rb rename to Library/Homebrew/test/cleaner_test.rb index 450a78d86a..ac108421c8 100644 --- a/Library/Homebrew/test/test_cleaner.rb +++ b/Library/Homebrew/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.rb b/Library/Homebrew/test/cleanup_test.rb similarity index 97% rename from Library/Homebrew/test/test_cleanup.rb rename to Library/Homebrew/test/cleanup_test.rb index dffcd12f2f..bb8e1cdc61 100644 --- a/Library/Homebrew/test/test_cleanup.rb +++ b/Library/Homebrew/test/cleanup_test.rb @@ -1,9 +1,9 @@ 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" class IntegrationCommandTestCleanup < IntegrationCommandTestCase def test_cleanup diff --git a/Library/Homebrew/test/test_command.rb b/Library/Homebrew/test/command_test.rb similarity index 85% rename from Library/Homebrew/test/test_command.rb rename to Library/Homebrew/test/command_test.rb index d051846313..d5c7aaa88c 100644 --- a/Library/Homebrew/test/test_command.rb +++ b/Library/Homebrew/test/command_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCommand < IntegrationCommandTestCase def test_command diff --git a/Library/Homebrew/test/test_commands.rb b/Library/Homebrew/test/commands_test.rb similarity index 98% rename from Library/Homebrew/test/test_commands.rb rename to Library/Homebrew/test/commands_test.rb index ef138049c1..d44d2da0e7 100644 --- a/Library/Homebrew/test/test_commands.rb +++ b/Library/Homebrew/test/commands_test.rb @@ -2,7 +2,7 @@ require "testing_env" require "cmd/command" require "cmd/commands" require "fileutils" -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCommands < IntegrationCommandTestCase def test_commands diff --git a/Library/Homebrew/test/test_compiler_failure.rb b/Library/Homebrew/test/compiler_failure_test.rb similarity index 100% rename from Library/Homebrew/test/test_compiler_failure.rb rename to Library/Homebrew/test/compiler_failure_test.rb diff --git a/Library/Homebrew/test/test_compiler_selector.rb b/Library/Homebrew/test/compiler_selector_test.rb similarity index 100% rename from Library/Homebrew/test/test_compiler_selector.rb rename to Library/Homebrew/test/compiler_selector_test.rb diff --git a/Library/Homebrew/test/test_config.rb b/Library/Homebrew/test/config_test.rb similarity index 79% rename from Library/Homebrew/test/test_config.rb rename to Library/Homebrew/test/config_test.rb index 33a2937357..81da4660af 100644 --- a/Library/Homebrew/test/test_config.rb +++ b/Library/Homebrew/test/config_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestConfig < IntegrationCommandTestCase def test_config diff --git a/Library/Homebrew/test/test_create.rb b/Library/Homebrew/test/create_test.rb similarity index 73% rename from Library/Homebrew/test/test_create.rb rename to Library/Homebrew/test/create_test.rb index bb1a2cd2af..aeee428aa9 100644 --- a/Library/Homebrew/test/test_create.rb +++ b/Library/Homebrew/test/create_test.rb @@ -1,8 +1,8 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCreate < IntegrationCommandTestCase def test_create - url = "file://#{File.expand_path("..", __FILE__)}/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.rb b/Library/Homebrew/test/custom_command_test.rb similarity index 90% rename from Library/Homebrew/test/test_custom_command.rb rename to Library/Homebrew/test/custom_command_test.rb index bc27e2121e..8d05bc6c7f 100644 --- a/Library/Homebrew/test/test_custom_command.rb +++ b/Library/Homebrew/test/custom_command_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase def test_custom_command diff --git a/Library/Homebrew/test/test_dependencies.rb b/Library/Homebrew/test/dependencies_test.rb similarity index 100% rename from Library/Homebrew/test/test_dependencies.rb rename to Library/Homebrew/test/dependencies_test.rb diff --git a/Library/Homebrew/test/test_dependency_collector.rb b/Library/Homebrew/test/dependency_collector_test.rb similarity index 100% rename from Library/Homebrew/test/test_dependency_collector.rb rename to Library/Homebrew/test/dependency_collector_test.rb diff --git a/Library/Homebrew/test/test_dependency_expansion.rb b/Library/Homebrew/test/dependency_expansion_test.rb similarity index 100% rename from Library/Homebrew/test/test_dependency_expansion.rb rename to Library/Homebrew/test/dependency_expansion_test.rb diff --git a/Library/Homebrew/test/test_dependency.rb b/Library/Homebrew/test/dependency_test.rb similarity index 100% rename from Library/Homebrew/test/test_dependency.rb rename to Library/Homebrew/test/dependency_test.rb diff --git a/Library/Homebrew/test/test_deps.rb b/Library/Homebrew/test/deps_test.rb similarity index 89% rename from Library/Homebrew/test/test_deps.rb rename to Library/Homebrew/test/deps_test.rb index 83cc9aa6a7..01639857c9 100644 --- a/Library/Homebrew/test/test_deps.rb +++ b/Library/Homebrew/test/deps_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestDeps < IntegrationCommandTestCase def test_deps diff --git a/Library/Homebrew/test/test_desc.rb b/Library/Homebrew/test/desc_test.rb similarity index 92% rename from Library/Homebrew/test/test_desc.rb rename to Library/Homebrew/test/desc_test.rb index 075ea991a2..2ba498135e 100644 --- a/Library/Homebrew/test/test_desc.rb +++ b/Library/Homebrew/test/desc_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestDesc < IntegrationCommandTestCase def test_desc diff --git a/Library/Homebrew/test/test_descriptions.rb b/Library/Homebrew/test/descriptions_test.rb similarity index 100% rename from Library/Homebrew/test/test_descriptions.rb rename to Library/Homebrew/test/descriptions_test.rb diff --git a/Library/Homebrew/test/test_diagnostic.rb b/Library/Homebrew/test/diagnostic_test.rb similarity index 100% rename from Library/Homebrew/test/test_diagnostic.rb rename to Library/Homebrew/test/diagnostic_test.rb diff --git a/Library/Homebrew/test/test_doctor.rb b/Library/Homebrew/test/doctor_test.rb similarity index 81% rename from Library/Homebrew/test/test_doctor.rb rename to Library/Homebrew/test/doctor_test.rb index ccb909dce0..d2dc871f40 100644 --- a/Library/Homebrew/test/test_doctor.rb +++ b/Library/Homebrew/test/doctor_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestDoctor < IntegrationCommandTestCase def test_doctor diff --git a/Library/Homebrew/test/test_download_strategies.rb b/Library/Homebrew/test/download_strategies_test.rb similarity index 100% rename from Library/Homebrew/test/test_download_strategies.rb rename to Library/Homebrew/test/download_strategies_test.rb diff --git a/Library/Homebrew/test/test_edit.rb b/Library/Homebrew/test/edit_test.rb similarity index 85% rename from Library/Homebrew/test/test_edit.rb rename to Library/Homebrew/test/edit_test.rb index 8d14371730..9b6ded6519 100644 --- a/Library/Homebrew/test/test_edit.rb +++ b/Library/Homebrew/test/edit_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestEdit < IntegrationCommandTestCase def test_edit diff --git a/Library/Homebrew/test/test_exceptions.rb b/Library/Homebrew/test/exceptions_test.rb similarity index 100% rename from Library/Homebrew/test/test_exceptions.rb rename to Library/Homebrew/test/exceptions_test.rb diff --git a/Library/Homebrew/test/test_fetch.rb b/Library/Homebrew/test/fetch_test.rb similarity index 84% rename from Library/Homebrew/test/test_fetch.rb rename to Library/Homebrew/test/fetch_test.rb index 7b57c62469..e08e545e3b 100644 --- a/Library/Homebrew/test/test_fetch.rb +++ b/Library/Homebrew/test/fetch_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestFetch < IntegrationCommandTestCase def test_fetch diff --git a/Library/Homebrew/test/test_formula_installer_bottle.rb b/Library/Homebrew/test/formula_installer_bottle_test.rb similarity index 95% rename from Library/Homebrew/test/test_formula_installer_bottle.rb rename to Library/Homebrew/test/formula_installer_bottle_test.rb index d83c856b7f..6a891f1591 100644 --- a/Library/Homebrew/test/test_formula_installer_bottle.rb +++ b/Library/Homebrew/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.rb b/Library/Homebrew/test/formula_installer_test.rb similarity index 97% rename from Library/Homebrew/test/test_formula_installer.rb rename to Library/Homebrew/test/formula_installer_test.rb index 18bd910a67..652548bd78 100644 --- a/Library/Homebrew/test/test_formula_installer.rb +++ b/Library/Homebrew/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_lock.rb b/Library/Homebrew/test/formula_lock_test.rb similarity index 100% rename from Library/Homebrew/test/test_formula_lock.rb rename to Library/Homebrew/test/formula_lock_test.rb diff --git a/Library/Homebrew/test/test_formula_pin.rb b/Library/Homebrew/test/formula_pin_test.rb similarity index 100% rename from Library/Homebrew/test/test_formula_pin.rb rename to Library/Homebrew/test/formula_pin_test.rb diff --git a/Library/Homebrew/test/test_formula_spec_selection.rb b/Library/Homebrew/test/formula_spec_selection_test.rb similarity index 100% rename from Library/Homebrew/test/test_formula_spec_selection.rb rename to Library/Homebrew/test/formula_spec_selection_test.rb diff --git a/Library/Homebrew/test/test_formula_support.rb b/Library/Homebrew/test/formula_support_test.rb similarity index 100% rename from Library/Homebrew/test/test_formula_support.rb rename to Library/Homebrew/test/formula_support_test.rb diff --git a/Library/Homebrew/test/test_formula.rb b/Library/Homebrew/test/formula_test.rb similarity index 99% rename from Library/Homebrew/test/test_formula.rb rename to Library/Homebrew/test/formula_test.rb index 4aa8355909..eef60a3e5f 100644 --- a/Library/Homebrew/test/test_formula.rb +++ b/Library/Homebrew/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_formula_validation.rb b/Library/Homebrew/test/formula_validation_test.rb similarity index 100% rename from Library/Homebrew/test/test_formula_validation.rb rename to Library/Homebrew/test/formula_validation_test.rb diff --git a/Library/Homebrew/test/test_formulary.rb b/Library/Homebrew/test/formulary_test.rb similarity index 97% rename from Library/Homebrew/test/test_formulary.rb rename to Library/Homebrew/test/formulary_test.rb index c545ff84da..3d88c84077 100644 --- a/Library/Homebrew/test/test_formulary.rb +++ b/Library/Homebrew/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("#{File.expand_path("..", __FILE__)}/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_gpg2_requirement.rb b/Library/Homebrew/test/gpg2_requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_gpg2_requirement.rb rename to Library/Homebrew/test/gpg2_requirement_test.rb diff --git a/Library/Homebrew/test/test_gpg.rb b/Library/Homebrew/test/gpg_test.rb similarity index 100% rename from Library/Homebrew/test/test_gpg.rb rename to Library/Homebrew/test/gpg_test.rb diff --git a/Library/Homebrew/test/test_hardware.rb b/Library/Homebrew/test/hardware_test.rb similarity index 100% rename from Library/Homebrew/test/test_hardware.rb rename to Library/Homebrew/test/hardware_test.rb diff --git a/Library/Homebrew/test/test_help.rb b/Library/Homebrew/test/help_test.rb similarity index 94% rename from Library/Homebrew/test/test_help.rb rename to Library/Homebrew/test/help_test.rb index 9c14f9b78f..92dd997217 100644 --- a/Library/Homebrew/test/test_help.rb +++ b/Library/Homebrew/test/help_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestHelp < IntegrationCommandTestCase def test_help diff --git a/Library/Homebrew/test/test_home.rb b/Library/Homebrew/test/home_test.rb similarity index 87% rename from Library/Homebrew/test/test_home.rb rename to Library/Homebrew/test/home_test.rb index 9c26353bec..ff06b72c1d 100644 --- a/Library/Homebrew/test/test_home.rb +++ b/Library/Homebrew/test/home_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestHome < IntegrationCommandTestCase def test_home diff --git a/Library/Homebrew/test/test_info.rb b/Library/Homebrew/test/info_test.rb similarity index 95% rename from Library/Homebrew/test/test_info.rb rename to Library/Homebrew/test/info_test.rb index 35f9183e13..f71044bf02 100644 --- a/Library/Homebrew/test/test_info.rb +++ b/Library/Homebrew/test/info_test.rb @@ -1,7 +1,7 @@ require "testing_env" require "cmd/info" require "formula" -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestInfo < IntegrationCommandTestCase def test_info diff --git a/Library/Homebrew/test/test_inreplace.rb b/Library/Homebrew/test/inreplace_test.rb similarity index 100% rename from Library/Homebrew/test/test_inreplace.rb rename to Library/Homebrew/test/inreplace_test.rb diff --git a/Library/Homebrew/test/test_install.rb b/Library/Homebrew/test/install_test.rb similarity index 96% rename from Library/Homebrew/test/test_install.rb rename to Library/Homebrew/test/install_test.rb index 7135dddb2d..fa1057a027 100644 --- a/Library/Homebrew/test/test_install.rb +++ b/Library/Homebrew/test/install_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestInstall < IntegrationCommandTestCase def test_install diff --git a/Library/Homebrew/test/test_irb.rb b/Library/Homebrew/test/irb_test.rb similarity index 89% rename from Library/Homebrew/test/test_irb.rb rename to Library/Homebrew/test/irb_test.rb index bf35b65241..832ca39a50 100644 --- a/Library/Homebrew/test/test_irb.rb +++ b/Library/Homebrew/test/irb_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestIrb < IntegrationCommandTestCase def test_irb diff --git a/Library/Homebrew/test/test_json.rb b/Library/Homebrew/test/json_test.rb similarity index 100% rename from Library/Homebrew/test/test_json.rb rename to Library/Homebrew/test/json_test.rb diff --git a/Library/Homebrew/test/test_keg.rb b/Library/Homebrew/test/keg_test.rb similarity index 100% rename from Library/Homebrew/test/test_keg.rb rename to Library/Homebrew/test/keg_test.rb diff --git a/Library/Homebrew/test/test_language_go.rb b/Library/Homebrew/test/language_go_test.rb similarity index 100% rename from Library/Homebrew/test/test_language_go.rb rename to Library/Homebrew/test/language_go_test.rb diff --git a/Library/Homebrew/test/test_language_module_requirement.rb b/Library/Homebrew/test/language_module_requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_language_module_requirement.rb rename to Library/Homebrew/test/language_module_requirement_test.rb diff --git a/Library/Homebrew/test/test_language_python.rb b/Library/Homebrew/test/language_python_test.rb similarity index 100% rename from Library/Homebrew/test/test_language_python.rb rename to Library/Homebrew/test/language_python_test.rb diff --git a/Library/Homebrew/test/test_leaves.rb b/Library/Homebrew/test/leaves_test.rb similarity index 88% rename from Library/Homebrew/test/test_leaves.rb rename to Library/Homebrew/test/leaves_test.rb index 2a9bbadd97..f73fba1ea3 100644 --- a/Library/Homebrew/test/test_leaves.rb +++ b/Library/Homebrew/test/leaves_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestLeaves < IntegrationCommandTestCase def test_leaves diff --git a/Library/Homebrew/test/test_link.rb b/Library/Homebrew/test/link_test.rb similarity index 93% rename from Library/Homebrew/test/test_link.rb rename to Library/Homebrew/test/link_test.rb index 3f05070724..062caa0c07 100644 --- a/Library/Homebrew/test/test_link.rb +++ b/Library/Homebrew/test/link_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestLink < IntegrationCommandTestCase def test_link diff --git a/Library/Homebrew/test/test_linkapps.rb b/Library/Homebrew/test/linkapps_test.rb similarity index 89% rename from Library/Homebrew/test/test_linkapps.rb rename to Library/Homebrew/test/linkapps_test.rb index b7c4cb8114..4c5b8ec134 100644 --- a/Library/Homebrew/test/test_linkapps.rb +++ b/Library/Homebrew/test/linkapps_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestLinkapps < IntegrationCommandTestCase def test_linkapps diff --git a/Library/Homebrew/test/test_list.rb b/Library/Homebrew/test/list_test.rb similarity index 85% rename from Library/Homebrew/test/test_list.rb rename to Library/Homebrew/test/list_test.rb index 1ffdb45286..3c691e3adc 100644 --- a/Library/Homebrew/test/test_list.rb +++ b/Library/Homebrew/test/list_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestList < IntegrationCommandTestCase def test_list diff --git a/Library/Homebrew/test/test_log_formula.rb b/Library/Homebrew/test/log_formula_test.rb similarity index 94% rename from Library/Homebrew/test/test_log_formula.rb rename to Library/Homebrew/test/log_formula_test.rb index 34509bf72b..bb6a1f6619 100644 --- a/Library/Homebrew/test/test_log_formula.rb +++ b/Library/Homebrew/test/log_formula_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestLogFormula < IntegrationCommandTestCase def test_log_formula diff --git a/Library/Homebrew/test/test_log.rb b/Library/Homebrew/test/log_test.rb similarity index 87% rename from Library/Homebrew/test/test_log.rb rename to Library/Homebrew/test/log_test.rb index b20a098fd8..b2e150ccd5 100644 --- a/Library/Homebrew/test/test_log.rb +++ b/Library/Homebrew/test/log_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestLog < IntegrationCommandTestCase def test_log diff --git a/Library/Homebrew/test/test_migrate.rb b/Library/Homebrew/test/migrate_test.rb similarity index 93% rename from Library/Homebrew/test/test_migrate.rb rename to Library/Homebrew/test/migrate_test.rb index 53b32777a3..17929d0383 100644 --- a/Library/Homebrew/test/test_migrate.rb +++ b/Library/Homebrew/test/migrate_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestMigrate < IntegrationCommandTestCase def test_migrate diff --git a/Library/Homebrew/test/test_migrator.rb b/Library/Homebrew/test/migrator_test.rb similarity index 99% rename from Library/Homebrew/test/test_migrator.rb rename to Library/Homebrew/test/migrator_test.rb index cefb8b7a34..8a2b6ad63e 100644 --- a/Library/Homebrew/test/test_migrator.rb +++ b/Library/Homebrew/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.rb b/Library/Homebrew/test/missing_test.rb similarity index 92% rename from Library/Homebrew/test/test_missing.rb rename to Library/Homebrew/test/missing_test.rb index 565f413daf..4f20d8a7af 100644 --- a/Library/Homebrew/test/test_missing.rb +++ b/Library/Homebrew/test/missing_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestMissing < IntegrationCommandTestCase def setup diff --git a/Library/Homebrew/test/test_mpi_requirement.rb b/Library/Homebrew/test/mpi_requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_mpi_requirement.rb rename to Library/Homebrew/test/mpi_requirement_test.rb diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/options_test.rb similarity index 98% rename from Library/Homebrew/test/test_options.rb rename to Library/Homebrew/test/options_test.rb index bfde7a9b64..e7189a6042 100644 --- a/Library/Homebrew/test/test_options.rb +++ b/Library/Homebrew/test/options_test.rb @@ -1,6 +1,6 @@ require "testing_env" require "options" -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestOptions < IntegrationCommandTestCase def test_options diff --git a/Library/Homebrew/test/test_os_mac_blacklist.rb b/Library/Homebrew/test/os/mac/blacklist_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_blacklist.rb rename to Library/Homebrew/test/os/mac/blacklist_test.rb diff --git a/Library/Homebrew/test/test_os_mac_bottle_collector.rb b/Library/Homebrew/test/os/mac/bottle_collector_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_bottle_collector.rb rename to Library/Homebrew/test/os/mac/bottle_collector_test.rb diff --git a/Library/Homebrew/test/test_os_mac_bottle_tag.rb b/Library/Homebrew/test/os/mac/bottle_tag_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_bottle_tag.rb rename to Library/Homebrew/test/os/mac/bottle_tag_test.rb diff --git a/Library/Homebrew/test/test_os_mac_dependency_collector.rb b/Library/Homebrew/test/os/mac/dependency_collector_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_dependency_collector.rb rename to Library/Homebrew/test/os/mac/dependency_collector_test.rb diff --git a/Library/Homebrew/test/test_os_mac_diagnostic.rb b/Library/Homebrew/test/os/mac/diagnostic_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_diagnostic.rb rename to Library/Homebrew/test/os/mac/diagnostic_test.rb diff --git a/Library/Homebrew/test/test_os_mac_keg.rb b/Library/Homebrew/test/os/mac/keg_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_keg.rb rename to Library/Homebrew/test/os/mac/keg_test.rb diff --git a/Library/Homebrew/test/test_os_mac_language.rb b/Library/Homebrew/test/os/mac/language_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_language.rb rename to Library/Homebrew/test/os/mac/language_test.rb diff --git a/Library/Homebrew/test/test_os_mac_mach.rb b/Library/Homebrew/test/os/mac/mach_test.rb similarity index 98% rename from Library/Homebrew/test/test_os_mac_mach.rb rename to Library/Homebrew/test/os/mac/mach_test.rb index 404a21d603..a42f7316b1 100644 --- a/Library/Homebrew/test/test_os_mac_mach.rb +++ b/Library/Homebrew/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_os_mac_version.rb b/Library/Homebrew/test/os/mac/version_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_version.rb rename to Library/Homebrew/test/os/mac/version_test.rb diff --git a/Library/Homebrew/test/test_os_mac_x11_requirement.rb b/Library/Homebrew/test/os/mac/x11_requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_os_mac_x11_requirement.rb rename to Library/Homebrew/test/os/mac/x11_requirement_test.rb diff --git a/Library/Homebrew/test/test_outdated.rb b/Library/Homebrew/test/outdated_test.rb similarity index 82% rename from Library/Homebrew/test/test_outdated.rb rename to Library/Homebrew/test/outdated_test.rb index cc0f024c8d..3e7148ded4 100644 --- a/Library/Homebrew/test/test_outdated.rb +++ b/Library/Homebrew/test/outdated_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestOutdated < IntegrationCommandTestCase def test_outdated diff --git a/Library/Homebrew/test/test_patch.rb b/Library/Homebrew/test/patch_test.rb similarity index 100% rename from Library/Homebrew/test/test_patch.rb rename to Library/Homebrew/test/patch_test.rb diff --git a/Library/Homebrew/test/test_patching.rb b/Library/Homebrew/test/patching_test.rb similarity index 91% rename from Library/Homebrew/test/test_patching.rb rename to Library/Homebrew/test/patching_test.rb index 18b848b10e..ac14c8e1e7 100644 --- a/Library/Homebrew/test/test_patching.rb +++ b/Library/Homebrew/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_pathname.rb b/Library/Homebrew/test/pathname_test.rb similarity index 100% rename from Library/Homebrew/test/test_pathname.rb rename to Library/Homebrew/test/pathname_test.rb diff --git a/Library/Homebrew/test/test_pin_unpin.rb b/Library/Homebrew/test/pin_unpin_test.rb similarity index 91% rename from Library/Homebrew/test/test_pin_unpin.rb rename to Library/Homebrew/test/pin_unpin_test.rb index 37682d45ee..65fb9e4daa 100644 --- a/Library/Homebrew/test/test_pin_unpin.rb +++ b/Library/Homebrew/test/pin_unpin_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase def test_pin_unpin diff --git a/Library/Homebrew/test/test_pkg_version.rb b/Library/Homebrew/test/pkg_version_test.rb similarity index 100% rename from Library/Homebrew/test/test_pkg_version.rb rename to Library/Homebrew/test/pkg_version_test.rb diff --git a/Library/Homebrew/test/test_prefix_formula.rb b/Library/Homebrew/test/prefix_formula_test.rb similarity index 80% rename from Library/Homebrew/test/test_prefix_formula.rb rename to Library/Homebrew/test/prefix_formula_test.rb index d76a966d73..eb5970d3e2 100644 --- a/Library/Homebrew/test/test_prefix_formula.rb +++ b/Library/Homebrew/test/prefix_formula_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPrefixFormula < IntegrationCommandTestCase def test_prefix_formula diff --git a/Library/Homebrew/test/test_prefix.rb b/Library/Homebrew/test/prefix_test.rb similarity index 77% rename from Library/Homebrew/test/test_prefix.rb rename to Library/Homebrew/test/prefix_test.rb index 4aa63fa071..a3ae755426 100644 --- a/Library/Homebrew/test/test_prefix.rb +++ b/Library/Homebrew/test/prefix_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPrefix < IntegrationCommandTestCase def test_prefix diff --git a/Library/Homebrew/test/test_prune.rb b/Library/Homebrew/test/prune_test.rb similarity index 93% rename from Library/Homebrew/test/test_prune.rb rename to Library/Homebrew/test/prune_test.rb index 293a3746dd..8fa5df7b7f 100644 --- a/Library/Homebrew/test/test_prune.rb +++ b/Library/Homebrew/test/prune_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPrune < IntegrationCommandTestCase def test_prune diff --git a/Library/Homebrew/test/test_pull_offline.rb b/Library/Homebrew/test/pull_offline_test.rb similarity index 88% rename from Library/Homebrew/test/test_pull_offline.rb rename to Library/Homebrew/test/pull_offline_test.rb index 2716af346d..c9d46cd74b 100644 --- a/Library/Homebrew/test/test_pull_offline.rb +++ b/Library/Homebrew/test/pull_offline_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPullOffline < IntegrationCommandTestCase def test_pull_offline diff --git a/Library/Homebrew/test/test_pull.rb b/Library/Homebrew/test/pull_test.rb similarity index 95% rename from Library/Homebrew/test/test_pull.rb rename to Library/Homebrew/test/pull_test.rb index 9707ff8a82..445d73cb18 100644 --- a/Library/Homebrew/test/test_pull.rb +++ b/Library/Homebrew/test/pull_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestPull < IntegrationCommandTestCase def test_pull diff --git a/Library/Homebrew/test/test_readall.rb b/Library/Homebrew/test/readall_test.rb similarity index 88% rename from Library/Homebrew/test/test_readall.rb rename to Library/Homebrew/test/readall_test.rb index d0c078e493..3eec79dd8b 100644 --- a/Library/Homebrew/test/test_readall.rb +++ b/Library/Homebrew/test/readall_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestReadall < IntegrationCommandTestCase def test_readall diff --git a/Library/Homebrew/test/test_reinstall_pinned.rb b/Library/Homebrew/test/reinstall_pinned_test.rb similarity index 90% rename from Library/Homebrew/test/test_reinstall_pinned.rb rename to Library/Homebrew/test/reinstall_pinned_test.rb index c9cb8a849f..80f5518ea9 100644 --- a/Library/Homebrew/test/test_reinstall_pinned.rb +++ b/Library/Homebrew/test/reinstall_pinned_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestReinstallPinned < IntegrationCommandTestCase def test_reinstall_pinned diff --git a/Library/Homebrew/test/test_reinstall.rb b/Library/Homebrew/test/reinstall_test.rb similarity index 89% rename from Library/Homebrew/test/test_reinstall.rb rename to Library/Homebrew/test/reinstall_test.rb index d07a960517..73877b35d5 100644 --- a/Library/Homebrew/test/test_reinstall.rb +++ b/Library/Homebrew/test/reinstall_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestReinstall < IntegrationCommandTestCase def test_reinstall diff --git a/Library/Homebrew/test/test_repository.rb b/Library/Homebrew/test/repository_test.rb similarity index 86% rename from Library/Homebrew/test/test_repository.rb rename to Library/Homebrew/test/repository_test.rb index 2029876ad7..77967a58da 100644 --- a/Library/Homebrew/test/test_repository.rb +++ b/Library/Homebrew/test/repository_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestRepository < IntegrationCommandTestCase def test_repository diff --git a/Library/Homebrew/test/test_requirement.rb b/Library/Homebrew/test/requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_requirement.rb rename to Library/Homebrew/test/requirement_test.rb diff --git a/Library/Homebrew/test/test_resource.rb b/Library/Homebrew/test/resource_test.rb similarity index 100% rename from Library/Homebrew/test/test_resource.rb rename to Library/Homebrew/test/resource_test.rb diff --git a/Library/Homebrew/test/test_sandbox.rb b/Library/Homebrew/test/sandbox_test.rb similarity index 100% rename from Library/Homebrew/test/test_sandbox.rb rename to Library/Homebrew/test/sandbox_test.rb diff --git a/Library/Homebrew/test/test_search_remote_tap.rb b/Library/Homebrew/test/search_remote_tap_test.rb similarity index 100% rename from Library/Homebrew/test/test_search_remote_tap.rb rename to Library/Homebrew/test/search_remote_tap_test.rb diff --git a/Library/Homebrew/test/test_search.rb b/Library/Homebrew/test/search_test.rb similarity index 96% rename from Library/Homebrew/test/test_search.rb rename to Library/Homebrew/test/search_test.rb index 8310d1c2b2..70b6f01fb1 100644 --- a/Library/Homebrew/test/test_search.rb +++ b/Library/Homebrew/test/search_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestSearch < IntegrationCommandTestCase def test_search diff --git a/Library/Homebrew/test/test_services.rb b/Library/Homebrew/test/services_test.rb similarity index 86% rename from Library/Homebrew/test/test_services.rb rename to Library/Homebrew/test/services_test.rb index b5ccb7c778..280aeb9f42 100644 --- a/Library/Homebrew/test/test_services.rb +++ b/Library/Homebrew/test/services_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestServices < IntegrationCommandTestCase def test_services diff --git a/Library/Homebrew/test/test_sh.rb b/Library/Homebrew/test/sh_test.rb similarity index 80% rename from Library/Homebrew/test/test_sh.rb rename to Library/Homebrew/test/sh_test.rb index 449b7b5b3e..48fcdc54ab 100644 --- a/Library/Homebrew/test/test_sh.rb +++ b/Library/Homebrew/test/sh_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestSh < IntegrationCommandTestCase def test_sh diff --git a/Library/Homebrew/test/test_shell.rb b/Library/Homebrew/test/shell_test.rb similarity index 100% rename from Library/Homebrew/test/test_shell.rb rename to Library/Homebrew/test/shell_test.rb diff --git a/Library/Homebrew/test/test_software_spec.rb b/Library/Homebrew/test/software_spec_test.rb similarity index 100% rename from Library/Homebrew/test/test_software_spec.rb rename to Library/Homebrew/test/software_spec_test.rb diff --git a/Library/Homebrew/test/test_stdlib.rb b/Library/Homebrew/test/stdlib_test.rb similarity index 100% rename from Library/Homebrew/test/test_stdlib.rb rename to Library/Homebrew/test/stdlib_test.rb diff --git a/Library/Homebrew/test/test_string.rb b/Library/Homebrew/test/string_test.rb similarity index 100% rename from Library/Homebrew/test/test_string.rb rename to Library/Homebrew/test/string_test.rb 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/support/helper/fs_leak_logger.rb b/Library/Homebrew/test/support/helper/fs_leak_logger.rb new file mode 100644 index 0000000000..f6a02dbc04 --- /dev/null +++ b/Library/Homebrew/test/support/helper/fs_leak_logger.rb @@ -0,0 +1,27 @@ +module Test + module Helper + module FSLeakLogger + def self.included(klass) + require "find" + 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 + + def before_setup + @__files_before_test = [] + Find.find(TEST_TMPDIR) { |f| @__files_before_test << f.sub(TEST_TMPDIR, "") } + super + end + + def after_teardown + super + files_after_test = [] + Find.find(TEST_TMPDIR) { |f| files_after_test << f.sub(TEST_TMPDIR, "") } + return if @__files_before_test == files_after_test + @@log.puts location, diff(@__files_before_test, files_after_test) + end + end + end +end 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 94% 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..5940fd84b6 100644 --- a/Library/Homebrew/test/helper/integration_command_test_case.rb +++ b/Library/Homebrew/test/support/helper/integration_command_test_case.rb @@ -1,8 +1,8 @@ require "bundler" -require "testing_env" require "fileutils" require "pathname" require "formula" +require "test/support/helper/test_case" class IntegrationCommandTestCase < Homebrew::TestCase def setup @@ -21,6 +21,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 +60,8 @@ 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 + -I#{HOMEBREW_LIBRARY_PATH} -rconfig ] if ENV["HOMEBREW_TESTS_COVERAGE"] @@ -70,7 +72,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase cmd_args << "-rbundler/setup" cmd_args << "-rsimplecov" end - cmd_args << "-rintegration_mocks" + cmd_args << "-rtest/support/helper/integration_mocks" cmd_args << (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path.to_s cmd_args += args developer = ENV["HOMEBREW_DEVELOPER"] @@ -125,7 +127,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 +197,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/lib/integration_mocks.rb b/Library/Homebrew/test/support/helper/integration_mocks.rb similarity index 100% rename from Library/Homebrew/test/lib/integration_mocks.rb rename to Library/Homebrew/test/support/helper/integration_mocks.rb 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/support/helper/test_case.rb b/Library/Homebrew/test/support/helper/test_case.rb new file mode 100644 index 0000000000..60c91e7bb3 --- /dev/null +++ b/Library/Homebrew/test/support/helper/test_case.rb @@ -0,0 +1,64 @@ +module Homebrew + class TestCase < ::Minitest::Test + require "test/support/helper/env" + require "test/support/helper/fs_leak_logger" + require "test/support/helper/shutup" + require "test/support/helper/version_assertions" + include Test::Helper::Env + include Test::Helper::FSLeakLogger + include Test::Helper::Shutup + include Test::Helper::VersionAssertions + + TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze + TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze + + def formula(name = "formula_name", path = Formulary.core_path(name), spec = :stable, alias_path: nil, &block) + @_f = Class.new(Formula, &block).new(name, path, spec, alias_path: alias_path) + end + + def mktmpdir(prefix_suffix = nil, &block) + Dir.mktmpdir(prefix_suffix, HOMEBREW_TEMP, &block) + end + + def needs_compat + skip "Requires compat/ code" if ENV["HOMEBREW_NO_COMPAT"] + end + + def needs_python + skip "Requires Python" unless which("python") + end + + def assert_nothing_raised + yield + end + + def assert_eql(exp, act, msg = nil) + msg = message(msg, "") { diff exp, act } + assert exp.eql?(act), msg + end + + def refute_eql(exp, act, msg = nil) + msg = message(msg) do + "Expected #{mu_pp(act)} to not be eql to #{mu_pp(exp)}" + end + refute exp.eql?(act), msg + end + + def dylib_path(name) + Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.dylib") + end + + def bundle_path(name) + Pathname.new("#{TEST_FIXTURE_DIR}/mach/#{name}.bundle") + end + + # Use a stubbed {Formulary::FormulaLoader} to make a given formula be found + # when loading from {Formulary} with `ref`. + def stub_formula_loader(formula, ref = formula.full_name) + loader = mock + loader.stubs(:get_formula).returns(formula) + Formulary.stubs(:loader_for).with(ref, from: :keg).returns(loader) + Formulary.stubs(:loader_for).with(ref, from: nil).returns(loader) + end + end +end diff --git a/Library/Homebrew/test/support/helper/version_assertions.rb b/Library/Homebrew/test/support/helper/version_assertions.rb new file mode 100644 index 0000000000..dc240d6434 --- /dev/null +++ b/Library/Homebrew/test/support/helper/version_assertions.rb @@ -0,0 +1,23 @@ +require "rubygems" + +module Test + module Helper + module VersionAssertions + def version(v) + Version.create(v) + end + + def assert_version_equal(expected, actual) + assert_equal Version.create(expected), actual + end + + def assert_version_detected(expected, url, specs = {}) + assert_equal expected, Version.detect(url, specs).to_s + end + + def assert_version_nil(url) + assert Version.parse(url).null? + end + end + end +end 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/test_switch.rb b/Library/Homebrew/test/switch_test.rb similarity index 92% rename from Library/Homebrew/test/test_switch.rb rename to Library/Homebrew/test/switch_test.rb index 88fdf85b98..af1926c39e 100644 --- a/Library/Homebrew/test/test_switch.rb +++ b/Library/Homebrew/test/switch_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestSwitch < IntegrationCommandTestCase def test_switch diff --git a/Library/Homebrew/test/test_tab.rb b/Library/Homebrew/test/tab_test.rb similarity index 99% rename from Library/Homebrew/test/test_tab.rb rename to Library/Homebrew/test/tab_test.rb index 2c756cf685..76c9aacc9f 100644 --- a/Library/Homebrew/test/test_tab.rb +++ b/Library/Homebrew/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.rb b/Library/Homebrew/test/tap_new_test.rb similarity index 85% rename from Library/Homebrew/test/test_tap_new.rb rename to Library/Homebrew/test/tap_new_test.rb index 636024b0aa..261a334f0f 100644 --- a/Library/Homebrew/test/test_tap_new.rb +++ b/Library/Homebrew/test/tap_new_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestTapNew < IntegrationCommandTestCase def test_tap_readme diff --git a/Library/Homebrew/test/test_tap.rb b/Library/Homebrew/test/tap_test.rb similarity index 99% rename from Library/Homebrew/test/test_tap.rb rename to Library/Homebrew/test/tap_test.rb index 71836aee94..b950cd1666 100644 --- a/Library/Homebrew/test/test_tap.rb +++ b/Library/Homebrew/test/tap_test.rb @@ -1,5 +1,5 @@ require "testing_env" -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestTap < IntegrationCommandTestCase def test_tap diff --git a/Library/Homebrew/test/test_test_formula.rb b/Library/Homebrew/test/test_formula_test.rb similarity index 86% rename from Library/Homebrew/test/test_test_formula.rb rename to Library/Homebrew/test/test_formula_test.rb index b3889d6a2f..5ad2db9e98 100644 --- a/Library/Homebrew/test/test_test_formula.rb +++ b/Library/Homebrew/test/test_formula_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestTestFormula < IntegrationCommandTestCase def test_test_formula @@ -13,7 +13,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/testing_env.rb b/Library/Homebrew/test/testing_env.rb index 3fbf3e4b5a..e2ba2e4e42 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,11 +9,7 @@ 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" require "parallel_tests/test/runtime_logger" require "mocha/setup" @@ -21,106 +17,5 @@ rescue LoadError abort "Run `bundle install` or install the mocha and minitest gems before running the tests" end -module Homebrew - module VersionAssertions - def version(v) - Version.create(v) - end - - def assert_version_equal(expected, actual) - assert_equal Version.create(expected), actual - end - - def assert_version_detected(expected, url, specs = {}) - assert_equal expected, Version.detect(url, specs).to_s - end - - def assert_version_nil(url) - assert Version.parse(url).null? - end - end - - module FSLeakLogger - def self.included(klass) - require "find" - @@log = File.open("#{__dir__}/fs_leak_log", "w") - klass.make_my_diffs_pretty! - end - - def before_setup - @__files_before_test = [] - Find.find(TEST_TMPDIR) { |f| @__files_before_test << f.sub(TEST_TMPDIR, "") } - super - end - - def after_teardown - super - files_after_test = [] - Find.find(TEST_TMPDIR) { |f| files_after_test << f.sub(TEST_TMPDIR, "") } - return if @__files_before_test == files_after_test - @@log.puts location, diff(@__files_before_test, files_after_test) - end - end - - class TestCase < ::Minitest::Test - require "test/helper/env" - require "test/helper/shutup" - include Test::Helper::Env - include Test::Helper::Shutup - - include VersionAssertions - include FSLeakLogger - - TEST_SHA1 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze - TEST_SHA256 = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef".freeze - - def formula(name = "formula_name", path = Formulary.core_path(name), spec = :stable, alias_path: nil, &block) - @_f = Class.new(Formula, &block).new(name, path, spec, alias_path: alias_path) - end - - def mktmpdir(prefix_suffix = nil, &block) - Dir.mktmpdir(prefix_suffix, HOMEBREW_TEMP, &block) - end - - def needs_compat - skip "Requires compat/ code" if ENV["HOMEBREW_NO_COMPAT"] - end - - def needs_python - skip "Requires Python" unless which("python") - end - - def assert_nothing_raised - yield - end - - def assert_eql(exp, act, msg = nil) - msg = message(msg, "") { diff exp, act } - assert exp.eql?(act), msg - end - - def refute_eql(exp, act, msg = nil) - msg = message(msg) do - "Expected #{mu_pp(act)} to not be eql to #{mu_pp(exp)}" - end - refute exp.eql?(act), msg - end - - def dylib_path(name) - Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.dylib") - end - - def bundle_path(name) - Pathname.new("#{TEST_DIRECTORY}/mach/#{name}.bundle") - end - - # Use a stubbed {Formulary::FormulaLoader} to make a given formula be found - # when loading from {Formulary} with `ref`. - def stub_formula_loader(formula, ref = formula.full_name) - loader = mock - loader.stubs(:get_formula).returns(formula) - Formulary.stubs(:loader_for).with(ref, from: :keg).returns(loader) - Formulary.stubs(:loader_for).with(ref, from: nil).returns(loader) - end - end -end +require "test/support/helper/test_case" +require "test/support/helper/integration_command_test_case" diff --git a/Library/Homebrew/test/test_uninstall.rb b/Library/Homebrew/test/uninstall_test.rb similarity index 97% rename from Library/Homebrew/test/test_uninstall.rb rename to Library/Homebrew/test/uninstall_test.rb index d86db0e805..70a6943531 100644 --- a/Library/Homebrew/test/test_uninstall.rb +++ b/Library/Homebrew/test/uninstall_test.rb @@ -1,4 +1,3 @@ -require "helper/integration_command_test_case" require "cmd/uninstall" class UninstallTests < Homebrew::TestCase diff --git a/Library/Homebrew/test/test_unlink.rb b/Library/Homebrew/test/unlink_test.rb similarity index 83% rename from Library/Homebrew/test/test_unlink.rb rename to Library/Homebrew/test/unlink_test.rb index 091bd8c45b..6d5cefc678 100644 --- a/Library/Homebrew/test/test_unlink.rb +++ b/Library/Homebrew/test/unlink_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestUnlink < IntegrationCommandTestCase def test_unlink diff --git a/Library/Homebrew/test/test_unlinkapps.rb b/Library/Homebrew/test/unlinkapps_test.rb similarity index 91% rename from Library/Homebrew/test/test_unlinkapps.rb rename to Library/Homebrew/test/unlinkapps_test.rb index 2de4e3ff8a..9d9672199c 100644 --- a/Library/Homebrew/test/test_unlinkapps.rb +++ b/Library/Homebrew/test/unlinkapps_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestUnlinkapps < IntegrationCommandTestCase def test_unlinkapps diff --git a/Library/Homebrew/test/test_unpack.rb b/Library/Homebrew/test/unpack_test.rb similarity index 86% rename from Library/Homebrew/test/test_unpack.rb rename to Library/Homebrew/test/unpack_test.rb index de1452a297..bbff6ad1c4 100644 --- a/Library/Homebrew/test/test_unpack.rb +++ b/Library/Homebrew/test/unpack_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestUnpack < IntegrationCommandTestCase def test_unpack diff --git a/Library/Homebrew/test/test_update_report.rb b/Library/Homebrew/test/update_report_test.rb similarity index 100% rename from Library/Homebrew/test/test_update_report.rb rename to Library/Homebrew/test/update_report_test.rb diff --git a/Library/Homebrew/test/test_upgrade.rb b/Library/Homebrew/test/upgrade_test.rb similarity index 86% rename from Library/Homebrew/test/test_upgrade.rb rename to Library/Homebrew/test/upgrade_test.rb index 73618293bc..f3f5dccc7a 100644 --- a/Library/Homebrew/test/test_upgrade.rb +++ b/Library/Homebrew/test/upgrade_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestUpgrade < IntegrationCommandTestCase def test_upgrade diff --git a/Library/Homebrew/test/test_uses.rb b/Library/Homebrew/test/uses_test.rb similarity index 89% rename from Library/Homebrew/test/test_uses.rb rename to Library/Homebrew/test/uses_test.rb index b0e79ef2d8..2b15554179 100644 --- a/Library/Homebrew/test/test_uses.rb +++ b/Library/Homebrew/test/uses_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestUses < IntegrationCommandTestCase def test_uses diff --git a/Library/Homebrew/test/utils/tty_test.rb b/Library/Homebrew/test/utils/tty_test.rb new file mode 100644 index 0000000000..09f092cbdc --- /dev/null +++ b/Library/Homebrew/test/utils/tty_test.rb @@ -0,0 +1,46 @@ +require "testing_env" +require "utils" + +class TtyTests < Homebrew::TestCase + def test_strip_ansi + assert_equal "hello", Tty.strip_ansi("\033\[36;7mhello\033\[0m") + end + + def test_width + assert_kind_of Integer, Tty.width + end + + def test_truncate + Tty.stubs(:width).returns 15 + assert_equal "foobar some", Tty.truncate("foobar something very long") + assert_equal "truncate", Tty.truncate("truncate") + + # When the terminal is unsupported, we report 0 width + Tty.stubs(:width).returns 0 + assert_equal "foobar something very long", Tty.truncate("foobar something very long") + end + + def test_no_tty_formatting + $stdout.stubs(:tty?).returns false + assert_equal "", Tty.to_s + assert_equal "", Tty.red.to_s + assert_equal "", Tty.green.to_s + assert_equal "", Tty.yellow.to_s + assert_equal "", Tty.blue.to_s + assert_equal "", Tty.magenta.to_s + assert_equal "", Tty.cyan.to_s + assert_equal "", Tty.default.to_s + end + + def test_formatting + $stdout.stubs(:tty?).returns(true) + assert_equal "", Tty.to_s + assert_equal "\033[31m", Tty.red.to_s + assert_equal "\033[32m", Tty.green.to_s + assert_equal "\033[33m", Tty.yellow.to_s + assert_equal "\033[34m", Tty.blue.to_s + assert_equal "\033[35m", Tty.magenta.to_s + assert_equal "\033[36m", Tty.cyan.to_s + assert_equal "\033[39m", Tty.default.to_s + end +end diff --git a/Library/Homebrew/test/test_utils.rb b/Library/Homebrew/test/utils_test.rb similarity index 83% rename from Library/Homebrew/test/test_utils.rb rename to Library/Homebrew/test/utils_test.rb index 7c0b6f78a1..146f57b495 100644 --- a/Library/Homebrew/test/test_utils.rb +++ b/Library/Homebrew/test/utils_test.rb @@ -3,50 +3,6 @@ require "utils" require "tempfile" require "utils/shell" -class TtyTests < Homebrew::TestCase - def test_strip_ansi - assert_equal "hello", Tty.strip_ansi("\033\[36;7mhello\033\[0m") - end - - def test_width - assert_kind_of Integer, Tty.width - end - - def test_truncate - Tty.stubs(:width).returns 15 - assert_equal "foobar some", Tty.truncate("foobar something very long") - assert_equal "truncate", Tty.truncate("truncate") - - # When the terminal is unsupported, we report 0 width - Tty.stubs(:width).returns 0 - assert_equal "foobar something very long", Tty.truncate("foobar something very long") - end - - def test_no_tty_formatting - $stdout.stubs(:tty?).returns false - assert_equal "", Tty.to_s - assert_equal "", Tty.red.to_s - assert_equal "", Tty.green.to_s - assert_equal "", Tty.yellow.to_s - assert_equal "", Tty.blue.to_s - assert_equal "", Tty.magenta.to_s - assert_equal "", Tty.cyan.to_s - assert_equal "", Tty.default.to_s - end - - def test_formatting - $stdout.stubs(:tty?).returns(true) - assert_equal "", Tty.to_s - assert_equal "\033[31m", Tty.red.to_s - assert_equal "\033[32m", Tty.green.to_s - assert_equal "\033[33m", Tty.yellow.to_s - assert_equal "\033[34m", Tty.blue.to_s - assert_equal "\033[35m", Tty.magenta.to_s - assert_equal "\033[36m", Tty.cyan.to_s - assert_equal "\033[39m", Tty.default.to_s - end -end - class UtilTests < Homebrew::TestCase def setup @dir = Pathname.new(mktmpdir) diff --git a/Library/Homebrew/test/test_version.rb b/Library/Homebrew/test/version_test.rb similarity index 78% rename from Library/Homebrew/test/test_version.rb rename to Library/Homebrew/test/version_test.rb index ca37e3567a..e7ffbc4f63 100644 --- a/Library/Homebrew/test/test_version.rb +++ b/Library/Homebrew/test/version_test.rb @@ -1,4 +1,4 @@ -require "helper/integration_command_test_case" +require "testing_env" class IntegrationCommandTestVersion < IntegrationCommandTestCase def test_version diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/versions_test.rb similarity index 100% rename from Library/Homebrew/test/test_versions.rb rename to Library/Homebrew/test/versions_test.rb diff --git a/Library/Homebrew/test/test_x11_requirement.rb b/Library/Homebrew/test/x11_requirement_test.rb similarity index 100% rename from Library/Homebrew/test/test_x11_requirement.rb rename to Library/Homebrew/test/x11_requirement_test.rb