diff options
| author | Markus Reiter | 2016-09-27 00:03:40 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-27 00:15:56 +0200 |
| commit | d508b124a43f4d1fd5500e9b023dcf9a1b41fc6a (patch) | |
| tree | 912e1ce8fd7ace5717c2a0dc08c8317e51ddf3dd /Library | |
| parent | cd677cf3aed7a0aed91c0f3428091d0fe52c60e9 (diff) | |
| download | brew-d508b124a43f4d1fd5500e9b023dcf9a1b41fc6a.tar.bz2 | |
Rename/merge test files.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/test/helper/integration_command_test_case.rb (renamed from Library/Homebrew/test/integration_cmds_tests.rb) | 6 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_ENV.rb | 28 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_analytics.rb (renamed from Library/Homebrew/test/test_integration_cmds_analytics.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_audit.rb (renamed from Library/Homebrew/test/test_cmd_audit.rb) | 0 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_bottle.rb (renamed from Library/Homebrew/test/test_integration_cmds_bottle.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_bundle.rb (renamed from Library/Homebrew/test/test_integration_cmds_bundle.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cache.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cache_formula.rb (renamed from Library/Homebrew/test/test_integration_cmds_cache_formula.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cask.rb (renamed from Library/Homebrew/test/test_integration_cmds_cask.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cat.rb (renamed from Library/Homebrew/test/test_integration_cmds_cat.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cellar.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cellar_formula.rb (renamed from Library/Homebrew/test/test_integration_cmds_cellar_formula.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_cleanup.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_command.rb (renamed from Library/Homebrew/test/test_integration_cmds_command.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_commands.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_config.rb (renamed from Library/Homebrew/test/test_integration_cmds_config.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_create.rb (renamed from Library/Homebrew/test/test_integration_cmds_create.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_custom_command.rb (renamed from Library/Homebrew/test/test_integration_cmds_custom_command.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_deps.rb (renamed from Library/Homebrew/test/test_integration_cmds_deps.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_desc.rb (renamed from Library/Homebrew/test/test_integration_cmds_desc.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_doctor.rb (renamed from Library/Homebrew/test/test_integration_cmds_doctor.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_edit.rb (renamed from Library/Homebrew/test/test_integration_cmds_edit.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_fetch.rb (renamed from Library/Homebrew/test/test_integration_cmds_fetch.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_help.rb (renamed from Library/Homebrew/test/test_integration_cmds_help.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_home.rb (renamed from Library/Homebrew/test/test_integration_cmds_home.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_info.rb (renamed from Library/Homebrew/test/test_cmd_info.rb) | 10 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_install.rb (renamed from Library/Homebrew/test/test_integration_cmds_install.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_cache.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_cellar.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_cleanup.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_commands.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_env.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_env_bash.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_env_csh.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_env_fish.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_env_plain.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_info.rb | 10 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_options.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_prefix.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_tap.rb | 30 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_integration_cmds_version.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_irb.rb (renamed from Library/Homebrew/test/test_integration_cmds_irb.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_leaves.rb (renamed from Library/Homebrew/test/test_integration_cmds_leaves.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_link.rb (renamed from Library/Homebrew/test/test_integration_cmds_link.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_linkapps.rb (renamed from Library/Homebrew/test/test_integration_cmds_linkapps.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_list.rb (renamed from Library/Homebrew/test/test_integration_cmds_list.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_log.rb (renamed from Library/Homebrew/test/test_integration_cmds_log.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_log_formula.rb (renamed from Library/Homebrew/test/test_integration_cmds_log_formula.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_migrate.rb (renamed from Library/Homebrew/test/test_integration_cmds_migrate.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_missing.rb (renamed from Library/Homebrew/test/test_integration_cmds_missing.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_options.rb | 12 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_outdated.rb (renamed from Library/Homebrew/test/test_integration_cmds_outdated.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_pin_unpin.rb (renamed from Library/Homebrew/test/test_integration_cmds_pin_unpin.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_prefix.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_prefix_formula.rb (renamed from Library/Homebrew/test/test_integration_cmds_prefix_formula.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_prune.rb (renamed from Library/Homebrew/test/test_integration_cmds_prune.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_pull.rb (renamed from Library/Homebrew/test/test_integration_cmds_pull.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_pull_offline.rb (renamed from Library/Homebrew/test/test_integration_cmds_pull_offline.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_readall.rb (renamed from Library/Homebrew/test/test_integration_cmds_readall.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_reinstall.rb (renamed from Library/Homebrew/test/test_integration_cmds_reinstall.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_reinstall_pinned.rb (renamed from Library/Homebrew/test/test_integration_cmds_reinstall_pinned.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_repository.rb (renamed from Library/Homebrew/test/test_integration_cmds_repository.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_search.rb (renamed from Library/Homebrew/test/test_integration_cmds_search.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_services.rb (renamed from Library/Homebrew/test/test_integration_cmds_services.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_sh.rb (renamed from Library/Homebrew/test/test_integration_cmds_sh.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_switch.rb (renamed from Library/Homebrew/test/test_integration_cmds_switch.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_tap.rb | 30 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_tap_readme.rb (renamed from Library/Homebrew/test/test_integration_cmds_tap_readme.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_test_formula.rb (renamed from Library/Homebrew/test/test_integration_cmds_test_formula.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_uninstall.rb (renamed from Library/Homebrew/test/test_integration_cmds_uninstall.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_unlink.rb (renamed from Library/Homebrew/test/test_integration_cmds_unlink.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_unlinkapps.rb (renamed from Library/Homebrew/test/test_integration_cmds_unlinkapps.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_unpack.rb (renamed from Library/Homebrew/test/test_integration_cmds_unpack.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_upgrade.rb (renamed from Library/Homebrew/test/test_integration_cmds_upgrade.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_uses.rb (renamed from Library/Homebrew/test/test_integration_cmds_uses.rb) | 4 | ||||
| -rw-r--r-- | Library/Homebrew/test/test_version.rb | 8 |
76 files changed, 231 insertions, 243 deletions
diff --git a/Library/Homebrew/test/integration_cmds_tests.rb b/Library/Homebrew/test/helper/integration_command_test_case.rb index a63b343c0..ab7fcbeaa 100644 --- a/Library/Homebrew/test/integration_cmds_tests.rb +++ b/Library/Homebrew/test/helper/integration_command_test_case.rb @@ -4,7 +4,7 @@ require "fileutils" require "pathname" require "formula" -class IntegrationCommandTests < Homebrew::TestCase +class IntegrationCommandTestCase < Homebrew::TestCase def setup @cmd_id_index = 0 # Assign unique IDs to invocations of `cmd_output`. (HOMEBREW_PREFIX/"bin").mkpath @@ -120,7 +120,7 @@ class IntegrationCommandTests < 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://#{File.expand_path("../..", __FILE__)}/tarballs/testball-0.1.tbz" sha256 "#{TESTBALL_SHA256}" option "with-foo", "Build with foo" @@ -189,6 +189,6 @@ class IntegrationCommandTests < Homebrew::TestCase end def testball - "#{File.expand_path("..", __FILE__)}/testball.rb" + "#{File.expand_path("../..", __FILE__)}/testball.rb" end end diff --git a/Library/Homebrew/test/test_ENV.rb b/Library/Homebrew/test/test_ENV.rb index 665e344e6..e38c75c6e 100644 --- a/Library/Homebrew/test/test_ENV.rb +++ b/Library/Homebrew/test/test_ENV.rb @@ -1,5 +1,33 @@ require "testing_env" require "extend/ENV" +require "helper/integration_command_test_case" + +class IntegrationCommandTestEnv < IntegrationCommandTestCase + def test_env + assert_match(/CMAKE_PREFIX_PATH="#{Regexp.escape(HOMEBREW_PREFIX)}[:"]/, + cmd("--env")) + end + + def test_env_fish + assert_match(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, + cmd("--env", "--shell=fish")) + end + + def test_env_csh + assert_match(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/, + cmd("--env", "--shell=tcsh")) + end + + def test_env_bash + assert_match(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, + cmd("--env", "--shell=bash")) + end + + def test_env_plain + assert_match(/CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}/, + cmd("--env", "--plain")) + end +end module SharedEnvTests def setup diff --git a/Library/Homebrew/test/test_integration_cmds_analytics.rb b/Library/Homebrew/test/test_analytics.rb index 17afe7fe8..00e0593db 100644 --- a/Library/Homebrew/test/test_integration_cmds_analytics.rb +++ b/Library/Homebrew/test/test_analytics.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestAnalytics < IntegrationCommandTests +class IntegrationCommandTestAnalytics < IntegrationCommandTestCase def test_analytics HOMEBREW_REPOSITORY.cd do shutup do diff --git a/Library/Homebrew/test/test_cmd_audit.rb b/Library/Homebrew/test/test_audit.rb index 98ab780b4..98ab780b4 100644 --- a/Library/Homebrew/test/test_cmd_audit.rb +++ b/Library/Homebrew/test/test_audit.rb diff --git a/Library/Homebrew/test/test_integration_cmds_bottle.rb b/Library/Homebrew/test/test_bottle.rb index b6d9de714..48727cfd9 100644 --- a/Library/Homebrew/test/test_integration_cmds_bottle.rb +++ b/Library/Homebrew/test/test_bottle.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestBottle < IntegrationCommandTests +class IntegrationCommandTestBottle < IntegrationCommandTestCase def test_bottle cmd("install", "--build-bottle", testball) assert_match "Formula not from core or any taps", diff --git a/Library/Homebrew/test/test_integration_cmds_bundle.rb b/Library/Homebrew/test/test_bundle.rb index 726bd4d10..6b040df1d 100644 --- a/Library/Homebrew/test/test_integration_cmds_bundle.rb +++ b/Library/Homebrew/test/test_bundle.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestBundle < IntegrationCommandTests +class IntegrationCommandTestBundle < IntegrationCommandTestCase def test_bundle needs_test_cmd_taps setup_remote_tap("homebrew/bundle") diff --git a/Library/Homebrew/test/test_cache.rb b/Library/Homebrew/test/test_cache.rb new file mode 100644 index 000000000..cd7a5e2fa --- /dev/null +++ b/Library/Homebrew/test/test_cache.rb @@ -0,0 +1,8 @@ +require "helper/integration_command_test_case" + +class IntegrationCommandTestCache < IntegrationCommandTestCase + def test_cache + assert_equal HOMEBREW_CACHE.to_s, + cmd("--cache") + end +end diff --git a/Library/Homebrew/test/test_integration_cmds_cache_formula.rb b/Library/Homebrew/test/test_cache_formula.rb index 82c3421b2..f4e37e2a2 100644 --- a/Library/Homebrew/test/test_integration_cmds_cache_formula.rb +++ b/Library/Homebrew/test/test_cache_formula.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCacheFormula < IntegrationCommandTests +class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase def test_cache_formula assert_match %r{#{HOMEBREW_CACHE}/testball-}, cmd("--cache", testball) diff --git a/Library/Homebrew/test/test_integration_cmds_cask.rb b/Library/Homebrew/test/test_cask.rb index e97bb868c..6f4f4601a 100644 --- a/Library/Homebrew/test/test_integration_cmds_cask.rb +++ b/Library/Homebrew/test/test_cask.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCask < IntegrationCommandTests +class IntegrationCommandTestCask < IntegrationCommandTestCase def test_cask needs_test_cmd_taps needs_macos diff --git a/Library/Homebrew/test/test_integration_cmds_cat.rb b/Library/Homebrew/test/test_cat.rb index ad4ef199b..4cfd19c3d 100644 --- a/Library/Homebrew/test/test_integration_cmds_cat.rb +++ b/Library/Homebrew/test/test_cat.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCat < IntegrationCommandTests +class IntegrationCommandTestCat < IntegrationCommandTestCase def test_cat formula_file = setup_test_formula "testball" assert_equal formula_file.read.chomp, cmd("cat", "testball") diff --git a/Library/Homebrew/test/test_cellar.rb b/Library/Homebrew/test/test_cellar.rb new file mode 100644 index 000000000..b793c5342 --- /dev/null +++ b/Library/Homebrew/test/test_cellar.rb @@ -0,0 +1,8 @@ +require "helper/integration_command_test_case" + +class IntegrationCommandTestCellar < IntegrationCommandTestCase + def test_cellar + assert_equal HOMEBREW_CELLAR.to_s, + cmd("--cellar") + end +end diff --git a/Library/Homebrew/test/test_integration_cmds_cellar_formula.rb b/Library/Homebrew/test/test_cellar_formula.rb index 356c79d6d..7c458be9d 100644 --- a/Library/Homebrew/test/test_integration_cmds_cellar_formula.rb +++ b/Library/Homebrew/test/test_cellar_formula.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCellarFormula < IntegrationCommandTests +class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase def test_cellar_formula assert_match "#{HOMEBREW_CELLAR}/testball", cmd("--cellar", testball) diff --git a/Library/Homebrew/test/test_cleanup.rb b/Library/Homebrew/test/test_cleanup.rb index 1351c85a6..dffcd12f2 100644 --- a/Library/Homebrew/test/test_cleanup.rb +++ b/Library/Homebrew/test/test_cleanup.rb @@ -3,6 +3,14 @@ require "testball" require "cleanup" require "fileutils" require "pathname" +require "helper/integration_command_test_case" + +class IntegrationCommandTestCleanup < IntegrationCommandTestCase + def test_cleanup + (HOMEBREW_CACHE/"test").write "test" + assert_match "#{HOMEBREW_CACHE}/test", cmd("cleanup", "--prune=all") + end +end class CleanupTests < Homebrew::TestCase def setup diff --git a/Library/Homebrew/test/test_integration_cmds_command.rb b/Library/Homebrew/test/test_command.rb index 33cfdc8ed..d05184631 100644 --- a/Library/Homebrew/test/test_integration_cmds_command.rb +++ b/Library/Homebrew/test/test_command.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCommand < IntegrationCommandTests +class IntegrationCommandTestCommand < IntegrationCommandTestCase def test_command assert_equal "#{HOMEBREW_LIBRARY_PATH}/cmd/info.rb", cmd("command", "info") diff --git a/Library/Homebrew/test/test_commands.rb b/Library/Homebrew/test/test_commands.rb index c51e81559..ef138049c 100644 --- a/Library/Homebrew/test/test_commands.rb +++ b/Library/Homebrew/test/test_commands.rb @@ -2,6 +2,14 @@ require "testing_env" require "cmd/command" require "cmd/commands" require "fileutils" +require "helper/integration_command_test_case" + +class IntegrationCommandTestCommands < IntegrationCommandTestCase + def test_commands + assert_match "Built-in commands", + cmd("commands") + end +end class CommandsTests < Homebrew::TestCase def setup diff --git a/Library/Homebrew/test/test_integration_cmds_config.rb b/Library/Homebrew/test/test_config.rb index f1cb5cb7e..33a293735 100644 --- a/Library/Homebrew/test/test_integration_cmds_config.rb +++ b/Library/Homebrew/test/test_config.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestConfig < IntegrationCommandTests +class IntegrationCommandTestConfig < IntegrationCommandTestCase def test_config assert_match "HOMEBREW_VERSION: #{HOMEBREW_VERSION}", cmd("config") diff --git a/Library/Homebrew/test/test_integration_cmds_create.rb b/Library/Homebrew/test/test_create.rb index 20765f9c8..b30e85547 100644 --- a/Library/Homebrew/test/test_integration_cmds_create.rb +++ b/Library/Homebrew/test/test_create.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCreate < IntegrationCommandTests +class IntegrationCommandTestCreate < IntegrationCommandTestCase def test_create url = "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz" cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat") diff --git a/Library/Homebrew/test/test_integration_cmds_custom_command.rb b/Library/Homebrew/test/test_custom_command.rb index 3ea2e6360..b3cd39f27 100644 --- a/Library/Homebrew/test/test_integration_cmds_custom_command.rb +++ b/Library/Homebrew/test/test_custom_command.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestCustomCommand < IntegrationCommandTests +class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase def test_custom_command mktmpdir do |path| cmd = "int-test-#{rand}" diff --git a/Library/Homebrew/test/test_integration_cmds_deps.rb b/Library/Homebrew/test/test_deps.rb index 10a654b60..83cc9aa6a 100644 --- a/Library/Homebrew/test/test_integration_cmds_deps.rb +++ b/Library/Homebrew/test/test_deps.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestDeps < IntegrationCommandTests +class IntegrationCommandTestDeps < IntegrationCommandTestCase def test_deps setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/test_integration_cmds_desc.rb b/Library/Homebrew/test/test_desc.rb index e93b71578..075ea991a 100644 --- a/Library/Homebrew/test/test_integration_cmds_desc.rb +++ b/Library/Homebrew/test/test_desc.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestDesc < IntegrationCommandTests +class IntegrationCommandTestDesc < IntegrationCommandTestCase def test_desc setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_doctor.rb b/Library/Homebrew/test/test_doctor.rb index e3edf1b0f..ccb909dce 100644 --- a/Library/Homebrew/test/test_integration_cmds_doctor.rb +++ b/Library/Homebrew/test/test_doctor.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestDoctor < IntegrationCommandTests +class IntegrationCommandTestDoctor < IntegrationCommandTestCase def test_doctor assert_match "This is an integration test", cmd_fail("doctor", "check_integration_test") diff --git a/Library/Homebrew/test/test_integration_cmds_edit.rb b/Library/Homebrew/test/test_edit.rb index b47e0d4f9..8d1437173 100644 --- a/Library/Homebrew/test/test_integration_cmds_edit.rb +++ b/Library/Homebrew/test/test_edit.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestEdit < IntegrationCommandTests +class IntegrationCommandTestEdit < IntegrationCommandTestCase def test_edit (HOMEBREW_REPOSITORY/".git").mkpath setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_fetch.rb b/Library/Homebrew/test/test_fetch.rb index 9c060a353..7b57c6246 100644 --- a/Library/Homebrew/test/test_integration_cmds_fetch.rb +++ b/Library/Homebrew/test/test_fetch.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestFetch < IntegrationCommandTests +class IntegrationCommandTestFetch < IntegrationCommandTestCase def test_fetch setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_help.rb b/Library/Homebrew/test/test_help.rb index 44fd774c9..9c14f9b78 100644 --- a/Library/Homebrew/test/test_integration_cmds_help.rb +++ b/Library/Homebrew/test/test_help.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestHelp < IntegrationCommandTests +class IntegrationCommandTestHelp < IntegrationCommandTestCase def test_help assert_match "Example usage:\n", cmd_fail # Generic help (empty argument list). diff --git a/Library/Homebrew/test/test_integration_cmds_home.rb b/Library/Homebrew/test/test_home.rb index ef21e85ca..9c26353be 100644 --- a/Library/Homebrew/test/test_integration_cmds_home.rb +++ b/Library/Homebrew/test/test_home.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestHome < IntegrationCommandTests +class IntegrationCommandTestHome < IntegrationCommandTestCase def test_home setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_cmd_info.rb b/Library/Homebrew/test/test_info.rb index ddc06ee01..35f9183e1 100644 --- a/Library/Homebrew/test/test_cmd_info.rb +++ b/Library/Homebrew/test/test_info.rb @@ -1,6 +1,16 @@ require "testing_env" require "cmd/info" require "formula" +require "helper/integration_command_test_case" + +class IntegrationCommandTestInfo < IntegrationCommandTestCase + def test_info + setup_test_formula "testball" + + assert_match "testball: stable 0.1", + cmd("info", "testball") + end +end class InfoCommandTests < Homebrew::TestCase def test_github_remote_path diff --git a/Library/Homebrew/test/test_integration_cmds_install.rb b/Library/Homebrew/test/test_install.rb index 7ce4a3484..5d27d978b 100644 --- a/Library/Homebrew/test/test_integration_cmds_install.rb +++ b/Library/Homebrew/test/test_install.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestInstall < IntegrationCommandTests +class IntegrationCommandTestInstall < IntegrationCommandTestCase def test_install setup_test_formula "testball1" assert_match "Specify `--HEAD`", cmd_fail("install", "testball1", "--head") diff --git a/Library/Homebrew/test/test_integration_cmds_cache.rb b/Library/Homebrew/test/test_integration_cmds_cache.rb deleted file mode 100644 index 716724f4f..000000000 --- a/Library/Homebrew/test/test_integration_cmds_cache.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestCache < IntegrationCommandTests - def test_cache - assert_equal HOMEBREW_CACHE.to_s, - cmd("--cache") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_cellar.rb b/Library/Homebrew/test/test_integration_cmds_cellar.rb deleted file mode 100644 index 3adb8fcca..000000000 --- a/Library/Homebrew/test/test_integration_cmds_cellar.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestCellar < IntegrationCommandTests - def test_cellar - assert_equal HOMEBREW_CELLAR.to_s, - cmd("--cellar") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_cleanup.rb b/Library/Homebrew/test/test_integration_cmds_cleanup.rb deleted file mode 100644 index fe9ce9952..000000000 --- a/Library/Homebrew/test/test_integration_cmds_cleanup.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestCleanup < IntegrationCommandTests - def test_cleanup - (HOMEBREW_CACHE/"test").write "test" - assert_match "#{HOMEBREW_CACHE}/test", cmd("cleanup", "--prune=all") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_commands.rb b/Library/Homebrew/test/test_integration_cmds_commands.rb deleted file mode 100644 index 47c4e25ca..000000000 --- a/Library/Homebrew/test/test_integration_cmds_commands.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestCommands < IntegrationCommandTests - def test_commands - assert_match "Built-in commands", - cmd("commands") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_env.rb b/Library/Homebrew/test/test_integration_cmds_env.rb deleted file mode 100644 index 9f6fc7cbb..000000000 --- a/Library/Homebrew/test/test_integration_cmds_env.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestEnv < IntegrationCommandTests - def test_env - assert_match(/CMAKE_PREFIX_PATH="#{Regexp.escape(HOMEBREW_PREFIX)}[:"]/, - cmd("--env")) - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_env_bash.rb b/Library/Homebrew/test/test_integration_cmds_env_bash.rb deleted file mode 100644 index 71f807199..000000000 --- a/Library/Homebrew/test/test_integration_cmds_env_bash.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestEnvBash < IntegrationCommandTests - def test_env_bash - assert_match(/export CMAKE_PREFIX_PATH="#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, - cmd("--env", "--shell=bash")) - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_env_csh.rb b/Library/Homebrew/test/test_integration_cmds_env_csh.rb deleted file mode 100644 index 19a6ed7d2..000000000 --- a/Library/Homebrew/test/test_integration_cmds_env_csh.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestEnvCsh < IntegrationCommandTests - def test_env_csh - assert_match(/setenv CMAKE_PREFIX_PATH #{Regexp.quote(HOMEBREW_PREFIX.to_s)};/, - cmd("--env", "--shell=tcsh")) - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_env_fish.rb b/Library/Homebrew/test/test_integration_cmds_env_fish.rb deleted file mode 100644 index 9c4bf0e16..000000000 --- a/Library/Homebrew/test/test_integration_cmds_env_fish.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestEnvFish < IntegrationCommandTests - def test_env_fish - assert_match(/set [-]gx CMAKE_PREFIX_PATH "#{Regexp.quote(HOMEBREW_PREFIX.to_s)}"/, - cmd("--env", "--shell=fish")) - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_env_plain.rb b/Library/Homebrew/test/test_integration_cmds_env_plain.rb deleted file mode 100644 index a21ad7f03..000000000 --- a/Library/Homebrew/test/test_integration_cmds_env_plain.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestEnvPlain < IntegrationCommandTests - def test_env_plain - assert_match(/CMAKE_PREFIX_PATH: #{Regexp.quote(HOMEBREW_PREFIX)}/, - cmd("--env", "--plain")) - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_info.rb b/Library/Homebrew/test/test_integration_cmds_info.rb deleted file mode 100644 index acb272d15..000000000 --- a/Library/Homebrew/test/test_integration_cmds_info.rb +++ /dev/null @@ -1,10 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestInfo < IntegrationCommandTests - def test_info - setup_test_formula "testball" - - assert_match "testball: stable 0.1", - cmd("info", "testball") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_options.rb b/Library/Homebrew/test/test_integration_cmds_options.rb deleted file mode 100644 index de527804c..000000000 --- a/Library/Homebrew/test/test_integration_cmds_options.rb +++ /dev/null @@ -1,12 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestOptions < IntegrationCommandTests - def test_options - setup_test_formula "testball", <<-EOS.undent - depends_on "bar" => :recommended - EOS - - assert_equal "--with-foo\n\tBuild with foo\n--without-bar\n\tBuild without bar support", - cmd_output("options", "testball").chomp - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_prefix.rb b/Library/Homebrew/test/test_integration_cmds_prefix.rb deleted file mode 100644 index 80a71c5ec..000000000 --- a/Library/Homebrew/test/test_integration_cmds_prefix.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestPrefix < IntegrationCommandTests - def test_prefix - assert_equal HOMEBREW_PREFIX.to_s, - cmd("--prefix") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_tap.rb b/Library/Homebrew/test/test_integration_cmds_tap.rb deleted file mode 100644 index 22cfd8e93..000000000 --- a/Library/Homebrew/test/test_integration_cmds_tap.rb +++ /dev/null @@ -1,30 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestTap < IntegrationCommandTests - def test_tap - path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" - path.mkpath - path.cd do - shutup do - system "git", "init" - system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" - FileUtils.touch "readme" - system "git", "add", "--all" - system "git", "commit", "-m", "init" - end - end - - assert_match "homebrew/foo", cmd("tap") - assert_match "homebrew/versions", cmd("tap", "--list-official") - assert_match "2 taps", cmd("tap-info") - assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "homebrew/foo") - assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "--json=v1", "--installed") - assert_match "Pinned homebrew/foo", cmd("tap-pin", "homebrew/foo") - assert_match "homebrew/foo", cmd("tap", "--list-pinned") - assert_match "Unpinned homebrew/foo", cmd("tap-unpin", "homebrew/foo") - assert_match "Tapped", cmd("tap", "homebrew/bar", path/".git") - assert_match "Untapped", cmd("untap", "homebrew/bar") - assert_equal "", cmd("tap", "homebrew/bar", path/".git", "-q", "--full") - assert_match "Untapped", cmd("untap", "homebrew/bar") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_version.rb b/Library/Homebrew/test/test_integration_cmds_version.rb deleted file mode 100644 index b434d0d95..000000000 --- a/Library/Homebrew/test/test_integration_cmds_version.rb +++ /dev/null @@ -1,8 +0,0 @@ -require "integration_cmds_tests" - -class IntegrationCommandTestVersion < IntegrationCommandTests - def test_version - assert_match HOMEBREW_VERSION.to_s, - cmd("--version") - end -end diff --git a/Library/Homebrew/test/test_integration_cmds_irb.rb b/Library/Homebrew/test/test_irb.rb index 338b32fd9..bf35b6524 100644 --- a/Library/Homebrew/test/test_integration_cmds_irb.rb +++ b/Library/Homebrew/test/test_irb.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestIrb < IntegrationCommandTests +class IntegrationCommandTestIrb < IntegrationCommandTestCase def test_irb assert_match "'v8'.f # => instance of the v8 formula", cmd("irb", "--examples") diff --git a/Library/Homebrew/test/test_integration_cmds_leaves.rb b/Library/Homebrew/test/test_leaves.rb index 2ea7779d6..2a9bbadd9 100644 --- a/Library/Homebrew/test/test_integration_cmds_leaves.rb +++ b/Library/Homebrew/test/test_leaves.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestLeaves < IntegrationCommandTests +class IntegrationCommandTestLeaves < IntegrationCommandTestCase def test_leaves setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/test_integration_cmds_link.rb b/Library/Homebrew/test/test_link.rb index 8c4255476..3f0507072 100644 --- a/Library/Homebrew/test/test_integration_cmds_link.rb +++ b/Library/Homebrew/test/test_link.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestLink < IntegrationCommandTests +class IntegrationCommandTestLink < IntegrationCommandTestCase def test_link assert_match "This command requires a keg argument", cmd_fail("link") diff --git a/Library/Homebrew/test/test_integration_cmds_linkapps.rb b/Library/Homebrew/test/test_linkapps.rb index 9afb84b77..b7c4cb811 100644 --- a/Library/Homebrew/test/test_integration_cmds_linkapps.rb +++ b/Library/Homebrew/test/test_linkapps.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestLinkapps < IntegrationCommandTests +class IntegrationCommandTestLinkapps < IntegrationCommandTestCase def test_linkapps home_dir = Pathname.new(mktmpdir) (home_dir/"Applications").mkpath diff --git a/Library/Homebrew/test/test_integration_cmds_list.rb b/Library/Homebrew/test/test_list.rb index 917366905..1ffdb4528 100644 --- a/Library/Homebrew/test/test_integration_cmds_list.rb +++ b/Library/Homebrew/test/test_list.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestList < IntegrationCommandTests +class IntegrationCommandTestList < IntegrationCommandTestCase def test_list formulae = %w[bar foo qux] formulae.each do |f| diff --git a/Library/Homebrew/test/test_integration_cmds_log.rb b/Library/Homebrew/test/test_log.rb index 1799d777d..b20a098fd 100644 --- a/Library/Homebrew/test/test_integration_cmds_log.rb +++ b/Library/Homebrew/test/test_log.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestLog < IntegrationCommandTests +class IntegrationCommandTestLog < IntegrationCommandTestCase def test_log FileUtils.cd HOMEBREW_REPOSITORY do shutup do diff --git a/Library/Homebrew/test/test_integration_cmds_log_formula.rb b/Library/Homebrew/test/test_log_formula.rb index 2f1f44d00..34509bf72 100644 --- a/Library/Homebrew/test/test_integration_cmds_log_formula.rb +++ b/Library/Homebrew/test/test_log_formula.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestLogFormula < IntegrationCommandTests +class IntegrationCommandTestLogFormula < IntegrationCommandTestCase def test_log_formula core_tap = CoreTap.new setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_migrate.rb b/Library/Homebrew/test/test_migrate.rb index 3918cbb3e..53b32777a 100644 --- a/Library/Homebrew/test/test_integration_cmds_migrate.rb +++ b/Library/Homebrew/test/test_migrate.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestMigrate < IntegrationCommandTests +class IntegrationCommandTestMigrate < IntegrationCommandTestCase def test_migrate setup_test_formula "testball1" setup_test_formula "testball2" diff --git a/Library/Homebrew/test/test_integration_cmds_missing.rb b/Library/Homebrew/test/test_missing.rb index 68c3a72a4..3a5fd3df0 100644 --- a/Library/Homebrew/test/test_integration_cmds_missing.rb +++ b/Library/Homebrew/test/test_missing.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestMissing < IntegrationCommandTests +class IntegrationCommandTestMissing < IntegrationCommandTestCase def test_missing setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/test_options.rb b/Library/Homebrew/test/test_options.rb index 9b123bc3c..bfde7a9b6 100644 --- a/Library/Homebrew/test/test_options.rb +++ b/Library/Homebrew/test/test_options.rb @@ -1,5 +1,17 @@ require "testing_env" require "options" +require "helper/integration_command_test_case" + +class IntegrationCommandTestOptions < IntegrationCommandTestCase + def test_options + setup_test_formula "testball", <<-EOS.undent + depends_on "bar" => :recommended + EOS + + assert_equal "--with-foo\n\tBuild with foo\n--without-bar\n\tBuild without bar support", + cmd_output("options", "testball").chomp + end +end class OptionTests < Homebrew::TestCase def setup diff --git a/Library/Homebrew/test/test_integration_cmds_outdated.rb b/Library/Homebrew/test/test_outdated.rb index b42e7bc1a..cc0f024c8 100644 --- a/Library/Homebrew/test/test_integration_cmds_outdated.rb +++ b/Library/Homebrew/test/test_outdated.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestOutdated < IntegrationCommandTests +class IntegrationCommandTestOutdated < IntegrationCommandTestCase def test_outdated setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath diff --git a/Library/Homebrew/test/test_integration_cmds_pin_unpin.rb b/Library/Homebrew/test/test_pin_unpin.rb index 828ca49c0..37682d45e 100644 --- a/Library/Homebrew/test/test_integration_cmds_pin_unpin.rb +++ b/Library/Homebrew/test/test_pin_unpin.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestPinUnpin < IntegrationCommandTests +class IntegrationCommandTestPinUnpin < IntegrationCommandTestCase def test_pin_unpin setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath diff --git a/Library/Homebrew/test/test_prefix.rb b/Library/Homebrew/test/test_prefix.rb new file mode 100644 index 000000000..4aa63fa07 --- /dev/null +++ b/Library/Homebrew/test/test_prefix.rb @@ -0,0 +1,8 @@ +require "helper/integration_command_test_case" + +class IntegrationCommandTestPrefix < IntegrationCommandTestCase + def test_prefix + assert_equal HOMEBREW_PREFIX.to_s, + cmd("--prefix") + end +end diff --git a/Library/Homebrew/test/test_integration_cmds_prefix_formula.rb b/Library/Homebrew/test/test_prefix_formula.rb index a901309cf..d76a966d7 100644 --- a/Library/Homebrew/test/test_integration_cmds_prefix_formula.rb +++ b/Library/Homebrew/test/test_prefix_formula.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestPrefixFormula < IntegrationCommandTests +class IntegrationCommandTestPrefixFormula < IntegrationCommandTestCase def test_prefix_formula assert_match "#{HOMEBREW_CELLAR}/testball", cmd("--prefix", testball) diff --git a/Library/Homebrew/test/test_integration_cmds_prune.rb b/Library/Homebrew/test/test_prune.rb index 6072c832e..293a3746d 100644 --- a/Library/Homebrew/test/test_integration_cmds_prune.rb +++ b/Library/Homebrew/test/test_prune.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestPrune < IntegrationCommandTests +class IntegrationCommandTestPrune < IntegrationCommandTestCase def test_prune share = (HOMEBREW_PREFIX/"share") diff --git a/Library/Homebrew/test/test_integration_cmds_pull.rb b/Library/Homebrew/test/test_pull.rb index 1cfb286a3..9707ff8a8 100644 --- a/Library/Homebrew/test/test_integration_cmds_pull.rb +++ b/Library/Homebrew/test/test_pull.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestPull < IntegrationCommandTests +class IntegrationCommandTestPull < IntegrationCommandTestCase def test_pull skip "Requires network connection" if ENV["HOMEBREW_NO_GITHUB_API"] diff --git a/Library/Homebrew/test/test_integration_cmds_pull_offline.rb b/Library/Homebrew/test/test_pull_offline.rb index bb6fd24cf..2716af346 100644 --- a/Library/Homebrew/test/test_integration_cmds_pull_offline.rb +++ b/Library/Homebrew/test/test_pull_offline.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestPullOffline < IntegrationCommandTests +class IntegrationCommandTestPullOffline < IntegrationCommandTestCase def test_pull_offline assert_match "You meant `git pull --rebase`.", cmd_fail("pull", "--rebase") assert_match "This command requires at least one argument", cmd_fail("pull") diff --git a/Library/Homebrew/test/test_integration_cmds_readall.rb b/Library/Homebrew/test/test_readall.rb index 1a6ca4547..d0c078e49 100644 --- a/Library/Homebrew/test/test_integration_cmds_readall.rb +++ b/Library/Homebrew/test/test_readall.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestReadall < IntegrationCommandTests +class IntegrationCommandTestReadall < IntegrationCommandTestCase def test_readall formula_file = setup_test_formula "testball" alias_file = CoreTap.new.alias_dir/"foobar" diff --git a/Library/Homebrew/test/test_integration_cmds_reinstall.rb b/Library/Homebrew/test/test_reinstall.rb index ce1c0c919..d07a96051 100644 --- a/Library/Homebrew/test/test_integration_cmds_reinstall.rb +++ b/Library/Homebrew/test/test_reinstall.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestReinstall < IntegrationCommandTests +class IntegrationCommandTestReinstall < IntegrationCommandTestCase def test_reinstall setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_reinstall_pinned.rb b/Library/Homebrew/test/test_reinstall_pinned.rb index dc4695e40..c9cb8a849 100644 --- a/Library/Homebrew/test/test_integration_cmds_reinstall_pinned.rb +++ b/Library/Homebrew/test/test_reinstall_pinned.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestReinstallPinned < IntegrationCommandTests +class IntegrationCommandTestReinstallPinned < IntegrationCommandTestCase def test_reinstall_pinned setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_repository.rb b/Library/Homebrew/test/test_repository.rb index a90dc1814..2029876ad 100644 --- a/Library/Homebrew/test/test_integration_cmds_repository.rb +++ b/Library/Homebrew/test/test_repository.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestRepository < IntegrationCommandTests +class IntegrationCommandTestRepository < IntegrationCommandTestCase def test_repository assert_match HOMEBREW_REPOSITORY.to_s, cmd("--repository") diff --git a/Library/Homebrew/test/test_integration_cmds_search.rb b/Library/Homebrew/test/test_search.rb index f85d1d67e..8310d1c2b 100644 --- a/Library/Homebrew/test/test_integration_cmds_search.rb +++ b/Library/Homebrew/test/test_search.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestSearch < IntegrationCommandTests +class IntegrationCommandTestSearch < IntegrationCommandTestCase def test_search setup_test_formula "testball" desc_cache = HOMEBREW_CACHE/"desc_cache.json" diff --git a/Library/Homebrew/test/test_integration_cmds_services.rb b/Library/Homebrew/test/test_services.rb index 043b5b0d6..b5ccb7c77 100644 --- a/Library/Homebrew/test/test_integration_cmds_services.rb +++ b/Library/Homebrew/test/test_services.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestServices < IntegrationCommandTests +class IntegrationCommandTestServices < IntegrationCommandTestCase def test_services needs_test_cmd_taps needs_macos diff --git a/Library/Homebrew/test/test_integration_cmds_sh.rb b/Library/Homebrew/test/test_sh.rb index be9e119c5..449b7b5b3 100644 --- a/Library/Homebrew/test/test_integration_cmds_sh.rb +++ b/Library/Homebrew/test/test_sh.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestSh < IntegrationCommandTests +class IntegrationCommandTestSh < IntegrationCommandTestCase def test_sh assert_match "Your shell has been configured", cmd("sh", "SHELL" => which("true")) diff --git a/Library/Homebrew/test/test_integration_cmds_switch.rb b/Library/Homebrew/test/test_switch.rb index 50b636d14..88fdf85b9 100644 --- a/Library/Homebrew/test/test_integration_cmds_switch.rb +++ b/Library/Homebrew/test/test_switch.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestSwitch < IntegrationCommandTests +class IntegrationCommandTestSwitch < IntegrationCommandTestCase def test_switch assert_match "Usage: brew switch <name> <version>", cmd_fail("switch") assert_match "testball not found", cmd_fail("switch", "testball", "0.1") diff --git a/Library/Homebrew/test/test_tap.rb b/Library/Homebrew/test/test_tap.rb index fafac252f..1396d0a0e 100644 --- a/Library/Homebrew/test/test_tap.rb +++ b/Library/Homebrew/test/test_tap.rb @@ -1,4 +1,34 @@ require "testing_env" +require "helper/integration_command_test_case" + +class IntegrationCommandTestTap < IntegrationCommandTestCase + def test_tap + path = Tap::TAP_DIRECTORY/"homebrew/homebrew-foo" + path.mkpath + path.cd do + shutup do + system "git", "init" + system "git", "remote", "add", "origin", "https://github.com/Homebrew/homebrew-foo" + FileUtils.touch "readme" + system "git", "add", "--all" + system "git", "commit", "-m", "init" + end + end + + assert_match "homebrew/foo", cmd("tap") + assert_match "homebrew/versions", cmd("tap", "--list-official") + assert_match "2 taps", cmd("tap-info") + assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "homebrew/foo") + assert_match "https://github.com/Homebrew/homebrew-foo", cmd("tap-info", "--json=v1", "--installed") + assert_match "Pinned homebrew/foo", cmd("tap-pin", "homebrew/foo") + assert_match "homebrew/foo", cmd("tap", "--list-pinned") + assert_match "Unpinned homebrew/foo", cmd("tap-unpin", "homebrew/foo") + assert_match "Tapped", cmd("tap", "homebrew/bar", path/".git") + assert_match "Untapped", cmd("untap", "homebrew/bar") + assert_equal "", cmd("tap", "homebrew/bar", path/".git", "-q", "--full") + assert_match "Untapped", cmd("untap", "homebrew/bar") + end +end class TapTest < Homebrew::TestCase include FileUtils diff --git a/Library/Homebrew/test/test_integration_cmds_tap_readme.rb b/Library/Homebrew/test/test_tap_readme.rb index c1f53c42d..1181c3ffc 100644 --- a/Library/Homebrew/test/test_integration_cmds_tap_readme.rb +++ b/Library/Homebrew/test/test_tap_readme.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestTapReadme < IntegrationCommandTests +class IntegrationCommandTestTapReadme < IntegrationCommandTestCase def test_tap_readme assert_match "brew install homebrew/foo/<formula>", cmd("tap-readme", "foo", "--verbose") diff --git a/Library/Homebrew/test/test_integration_cmds_test_formula.rb b/Library/Homebrew/test/test_test_formula.rb index 4350fdbe9..b3889d6a2 100644 --- a/Library/Homebrew/test/test_integration_cmds_test_formula.rb +++ b/Library/Homebrew/test/test_test_formula.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestTestFormula < IntegrationCommandTests +class IntegrationCommandTestTestFormula < IntegrationCommandTestCase def test_test_formula assert_match "This command requires a formula argument", cmd_fail("test") assert_match "Testing requires the latest version of testball", diff --git a/Library/Homebrew/test/test_integration_cmds_uninstall.rb b/Library/Homebrew/test/test_uninstall.rb index 6f82bedc7..050934238 100644 --- a/Library/Homebrew/test/test_integration_cmds_uninstall.rb +++ b/Library/Homebrew/test/test_uninstall.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUninstall < IntegrationCommandTests +class IntegrationCommandTestUninstall < IntegrationCommandTestCase def test_uninstall cmd("install", testball) assert_match "Uninstalling testball", cmd("uninstall", "--force", testball) diff --git a/Library/Homebrew/test/test_integration_cmds_unlink.rb b/Library/Homebrew/test/test_unlink.rb index b64cc8140..091bd8c45 100644 --- a/Library/Homebrew/test/test_integration_cmds_unlink.rb +++ b/Library/Homebrew/test/test_unlink.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUnlink < IntegrationCommandTests +class IntegrationCommandTestUnlink < IntegrationCommandTestCase def test_unlink setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_unlinkapps.rb b/Library/Homebrew/test/test_unlinkapps.rb index 047f17a1d..2de4e3ff8 100644 --- a/Library/Homebrew/test/test_integration_cmds_unlinkapps.rb +++ b/Library/Homebrew/test/test_unlinkapps.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUnlinkapps < IntegrationCommandTests +class IntegrationCommandTestUnlinkapps < IntegrationCommandTestCase def test_unlinkapps home_dir = Pathname.new(mktmpdir) apps_dir = home_dir/"Applications" diff --git a/Library/Homebrew/test/test_integration_cmds_unpack.rb b/Library/Homebrew/test/test_unpack.rb index 1b6e97e52..de1452a29 100644 --- a/Library/Homebrew/test/test_integration_cmds_unpack.rb +++ b/Library/Homebrew/test/test_unpack.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUnpack < IntegrationCommandTests +class IntegrationCommandTestUnpack < IntegrationCommandTestCase def test_unpack setup_test_formula "testball" diff --git a/Library/Homebrew/test/test_integration_cmds_upgrade.rb b/Library/Homebrew/test/test_upgrade.rb index 5eee33d56..73618293b 100644 --- a/Library/Homebrew/test/test_integration_cmds_upgrade.rb +++ b/Library/Homebrew/test/test_upgrade.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUpgrade < IntegrationCommandTests +class IntegrationCommandTestUpgrade < IntegrationCommandTestCase def test_upgrade setup_test_formula "testball" (HOMEBREW_CELLAR/"testball/0.0.1/foo").mkpath diff --git a/Library/Homebrew/test/test_integration_cmds_uses.rb b/Library/Homebrew/test/test_uses.rb index e5c0c0f77..b0e79ef2d 100644 --- a/Library/Homebrew/test/test_integration_cmds_uses.rb +++ b/Library/Homebrew/test/test_uses.rb @@ -1,6 +1,6 @@ -require "integration_cmds_tests" +require "helper/integration_command_test_case" -class IntegrationCommandTestUses < IntegrationCommandTests +class IntegrationCommandTestUses < IntegrationCommandTestCase def test_uses setup_test_formula "foo" setup_test_formula "bar" diff --git a/Library/Homebrew/test/test_version.rb b/Library/Homebrew/test/test_version.rb new file mode 100644 index 000000000..ca37e3567 --- /dev/null +++ b/Library/Homebrew/test/test_version.rb @@ -0,0 +1,8 @@ +require "helper/integration_command_test_case" + +class IntegrationCommandTestVersion < IntegrationCommandTestCase + def test_version + assert_match HOMEBREW_VERSION.to_s, + cmd("--version") + end +end |
