diff --git a/Library/Homebrew/test/integration_cmds_tests.rb b/Library/Homebrew/test/helper/integration_command_test_case.rb similarity index 96% rename from Library/Homebrew/test/integration_cmds_tests.rb rename to Library/Homebrew/test/helper/integration_command_test_case.rb index a63b343c0303f24a49866258b5e6279bae8475da..ab7fcbeaa0bd933c26d19a2eadfa25187a914780 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 665e344e63ac9119a3dd529e85fd2f6656900366..e38c75c6e49b7d2a983279b3105059a814cfb8f5 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 similarity index 85% rename from Library/Homebrew/test/test_integration_cmds_analytics.rb rename to Library/Homebrew/test/test_analytics.rb index 17afe7fe85412c2166a4bb4149349dbb9ae9c256..00e0593db4ab7a9f81b62222f8abaa5f6fc19b78 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 similarity index 100% rename from Library/Homebrew/test/test_cmd_audit.rb rename to Library/Homebrew/test/test_audit.rb diff --git a/Library/Homebrew/test/test_integration_cmds_bottle.rb b/Library/Homebrew/test/test_bottle.rb similarity index 84% rename from Library/Homebrew/test/test_integration_cmds_bottle.rb rename to Library/Homebrew/test/test_bottle.rb index b6d9de714cd7a109dada0ba9d5de35bd824d2d78..48727cfd905d8da230d3d1bda2637804aeb5e14e 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 similarity index 80% rename from Library/Homebrew/test/test_integration_cmds_bundle.rb rename to Library/Homebrew/test/test_bundle.rb index 726bd4d106a52f3cd40d1370f952f56756b5170f..6b040df1dbae885a293976999087fffceba93f5e 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 0000000000000000000000000000000000000000..cd7a5e2fab13d386282f14c668aa81637613751d --- /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 similarity index 78% rename from Library/Homebrew/test/test_integration_cmds_cache_formula.rb rename to Library/Homebrew/test/test_cache_formula.rb index 82c3421b2429f778abe770c823826f9fef5e4a61..f4e37e2a2e874ec25551d20a84dd766072a4a41c 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 similarity index 54% rename from Library/Homebrew/test/test_integration_cmds_cask.rb rename to Library/Homebrew/test/test_cask.rb index e97bb868c5b14ed963f0f65c29a0f6659ddc1a62..6f4f4601a9d1787b7a644b85ec0ebba4556c6391 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 similarity index 56% rename from Library/Homebrew/test/test_integration_cmds_cat.rb rename to Library/Homebrew/test/test_cat.rb index ad4ef199b6a258f692b321c39749335c7df76927..4cfd19c3dc6a5625de9aa59f9b220d864e6e3fbf 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 0000000000000000000000000000000000000000..b793c534245ff27b731660c31e0ee1e848c64ed5 --- /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 similarity index 78% rename from Library/Homebrew/test/test_integration_cmds_cellar_formula.rb rename to Library/Homebrew/test/test_cellar_formula.rb index 356c79d6d4d7565c1137a2585dc6555e1645c18d..7c458be9d021c19dd988d02fea553b9e5d6ef574 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 1351c85a6c98c9b53dcbcec5fa7d8e6f5242cd5a..dffcd12f2f5a5dd42aa56ea2bf2c7b29aa71595e 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 similarity index 66% rename from Library/Homebrew/test/test_integration_cmds_command.rb rename to Library/Homebrew/test/test_command.rb index 33cfdc8ed5cc2ea1e7cfeb59daa6af97cd7959d6..d05184631305b7505274d29b083f6781378b1748 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 c51e8155903744d2af01581f9f59da1743893c71..ef138049c17ed2a27a1a351302d42645ce06099b 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 similarity index 51% rename from Library/Homebrew/test/test_integration_cmds_config.rb rename to Library/Homebrew/test/test_config.rb index f1cb5cb7e9b3ecbe25246bb206411da34cbfe1d3..33a29373570c676bef1f8d7b96d0a6c28fa8f43b 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 similarity index 76% rename from Library/Homebrew/test/test_integration_cmds_create.rb rename to Library/Homebrew/test/test_create.rb index 20765f9c82b08a455e37e40646e568b244dbad49..b30e8554782efefa2dd6f68bb27dec4fafe0977a 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 similarity index 88% rename from Library/Homebrew/test/test_integration_cmds_custom_command.rb rename to Library/Homebrew/test/test_custom_command.rb index 3ea2e6360dc59b1cfb4a4cd516c8c5e53fc64227..b3cd39f276f10ef7105b2e6ca5cbfe9acebef13c 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 similarity index 75% rename from Library/Homebrew/test/test_integration_cmds_deps.rb rename to Library/Homebrew/test/test_deps.rb index 10a654b60ca421117e0cb2c6f4f045ff366057b9..83cc9aa6a779078b72d195562e10dcfd7fd18184 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 similarity index 82% rename from Library/Homebrew/test/test_integration_cmds_desc.rb rename to Library/Homebrew/test/test_desc.rb index e93b715782441b7e8784794b9795d8bea68df0af..075ea991a226370331419b58f7521106ea9cd785 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 similarity index 55% rename from Library/Homebrew/test/test_integration_cmds_doctor.rb rename to Library/Homebrew/test/test_doctor.rb index e3edf1b0f561dd68f1db92639e3c8320bcd991fb..ccb909dce05175392ea58447ac0584be1cabb71f 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 similarity index 66% rename from Library/Homebrew/test/test_integration_cmds_edit.rb rename to Library/Homebrew/test/test_edit.rb index b47e0d4f9ae507335e39540a7b77d0e2c4c22b23..8d14371730c964dd6b41f6642e8948c16145fd93 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 similarity index 63% rename from Library/Homebrew/test/test_integration_cmds_fetch.rb rename to Library/Homebrew/test/test_fetch.rb index 9c060a3538a70f275f003ade2641da431eb60f1f..7b57c62469ccb92fa87006ab4e297dd1490eab3d 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 similarity index 88% rename from Library/Homebrew/test/test_integration_cmds_help.rb rename to Library/Homebrew/test/test_help.rb index 44fd774c9732d2a3d4148036c533e4bff82d66e4..9c14f9b78fbcfb0e5014a54a514ca885f7255bcc 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 similarity index 71% rename from Library/Homebrew/test/test_integration_cmds_home.rb rename to Library/Homebrew/test/test_home.rb index ef21e85ca1353e2f4546a2cc2a2955c16f7c6257..9c26353becc75c58bc717de1bf3072452798eb8a 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 similarity index 75% rename from Library/Homebrew/test/test_cmd_info.rb rename to Library/Homebrew/test/test_info.rb index ddc06ee01c33599a08efe1fa60b694316925ac90..35f9183e139359f962ab749a9971cfa4d003b27e 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 similarity index 90% rename from Library/Homebrew/test/test_integration_cmds_install.rb rename to Library/Homebrew/test/test_install.rb index 7ce4a3484d5104f3bd9d60b5e7edbf5f83621373..5d27d978b09612c054f29696fa71e0637f7fb558 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 716724f4f968293a58efe16854e8beed7154e5b3..0000000000000000000000000000000000000000 --- 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 3adb8fccad77a67bd91dfdc960ab738ec8a760f3..0000000000000000000000000000000000000000 --- 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 fe9ce9952ce1bf0854b695f29a69e46e5a0b84ff..0000000000000000000000000000000000000000 --- 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 47c4e25ca68b4f634d7cd81e6e237f5f340221ef..0000000000000000000000000000000000000000 --- 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 9f6fc7cbb42fe54ae1679457d724977aca87e6a6..0000000000000000000000000000000000000000 --- 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 71f807199f03cd7812513ad4910650723775deb5..0000000000000000000000000000000000000000 --- 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 19a6ed7d2f95314f051f1cb33f66e65fea0dbccd..0000000000000000000000000000000000000000 --- 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 9c4bf0e16d225bbf0de586e48216f7fc2cede27b..0000000000000000000000000000000000000000 --- 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 a21ad7f033cf08860d794ed4f0e6ca408390b2fb..0000000000000000000000000000000000000000 --- 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 acb272d15b37af5a4cd8a3638bc7db31e0a67be8..0000000000000000000000000000000000000000 --- 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 de527804c0cdf7f465ed41363b4bd2aed9508262..0000000000000000000000000000000000000000 --- 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 80a71c5ec9625a7af9ce153791a9716a6be4d50b..0000000000000000000000000000000000000000 --- 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 22cfd8e93b549cd0d9e139f33db9c4a4b2e0ca03..0000000000000000000000000000000000000000 --- 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 b434d0d955ed166133329f3fb1acf35bf98f81e5..0000000000000000000000000000000000000000 --- 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 similarity index 76% rename from Library/Homebrew/test/test_integration_cmds_irb.rb rename to Library/Homebrew/test/test_irb.rb index 338b32fd97928f08cf5ca5d62013f74f148016b3..bf35b65241132f87b81bbbc65018d57dae0278b2 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 similarity index 72% rename from Library/Homebrew/test/test_integration_cmds_leaves.rb rename to Library/Homebrew/test/test_leaves.rb index 2ea7779d69da7127d89bc7cf088ae3167e7ccc00..2a9bbadd97ea20f29483f1bbea98decd76176d9e 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 similarity index 85% rename from Library/Homebrew/test/test_integration_cmds_link.rb rename to Library/Homebrew/test/test_link.rb index 8c4255476f6e31530035e85bf751eaa4c8c51606..3f050707243ce034b2d05f927296c59a4b105fd4 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 similarity index 73% rename from Library/Homebrew/test/test_integration_cmds_linkapps.rb rename to Library/Homebrew/test/test_linkapps.rb index 9afb84b77bc29713bb018c3ca6f09ee04a50e357..b7c4cb81144756a21edd783e230c41c21f13d28d 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 similarity index 65% rename from Library/Homebrew/test/test_integration_cmds_list.rb rename to Library/Homebrew/test/test_list.rb index 917366905f57dceca66b4da24ba2da7e85745e3b..1ffdb45286d61dd36c3f38fbc33dd256aad96d83 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 similarity index 70% rename from Library/Homebrew/test/test_integration_cmds_log.rb rename to Library/Homebrew/test/test_log.rb index 1799d777db52af418352777c9d61ff3c0fc7d895..b20a098fd861aad26bb198cc3a6d8269b637720c 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 similarity index 86% rename from Library/Homebrew/test/test_integration_cmds_log_formula.rb rename to Library/Homebrew/test/test_log_formula.rb index 2f1f44d0056cbd75f4a4fc12582d25e4c2ea1182..34509bf72b8d42068d000a76e25c6108ad7f852e 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 similarity index 84% rename from Library/Homebrew/test/test_integration_cmds_migrate.rb rename to Library/Homebrew/test/test_migrate.rb index 3918cbb3e68cbc6259122267c1b01a919a5c0aa6..53b32777a39fe3a0274bb2e1982695ae192d9d8f 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 similarity index 59% rename from Library/Homebrew/test/test_integration_cmds_missing.rb rename to Library/Homebrew/test/test_missing.rb index 68c3a72a45bc6ac786323d09b64f50fafaa476ef..3a5fd3df09831eeb9d73b11cc08ec97ef29532a5 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 9b123bc3c9c815434e2bac37eed45fa6e7dabf8a..bfde7a9b64deb58de0265b5ca5e9f81a674b71c0 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 similarity index 58% rename from Library/Homebrew/test/test_integration_cmds_outdated.rb rename to Library/Homebrew/test/test_outdated.rb index b42e7bc1a23b7e4a3e347c5895f75aa15c7c7706..cc0f024c8daddeabaddc02614bf462088b5147e3 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 similarity index 79% rename from Library/Homebrew/test/test_integration_cmds_pin_unpin.rb rename to Library/Homebrew/test/test_pin_unpin.rb index 828ca49c04e29382e7d80e2cf0bbb9980199a4fd..37682d45eebc93ebd93c090fc56be3d5977781d8 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 0000000000000000000000000000000000000000..4aa63fa0710a5b2288be7664b95d6f0b4cebdc54 --- /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 similarity index 78% rename from Library/Homebrew/test/test_integration_cmds_prefix_formula.rb rename to Library/Homebrew/test/test_prefix_formula.rb index a901309cf7123edbb908cf5e23bb316b2aa5e40b..d76a966d7374c44404928c5e1286f00a128f6d3a 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 similarity index 85% rename from Library/Homebrew/test/test_integration_cmds_prune.rb rename to Library/Homebrew/test/test_prune.rb index 6072c832eb3f3ef34b1f07aab973194c7d8aa5c5..293a3746dd66ef20db9e39aaf8f38e353fbb7e86 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 similarity index 88% rename from Library/Homebrew/test/test_integration_cmds_pull.rb rename to Library/Homebrew/test/test_pull.rb index 1cfb286a3f2bf693565849565f03d6e4d753a8ba..9707ff8a82de07e606506ebcfc715113f2d4c367 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 similarity index 86% rename from Library/Homebrew/test/test_integration_cmds_pull_offline.rb rename to Library/Homebrew/test/test_pull_offline.rb index bb6fd24cffcd573cfe49ebd82f1c78c3608c1681..2716af346d2dedd233da9fb3d1790cc8fdfd3390 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 similarity index 71% rename from Library/Homebrew/test/test_integration_cmds_readall.rb rename to Library/Homebrew/test/test_readall.rb index 1a6ca45471f4073ff22a846097d97705f8900c60..d0c078e493da1e7da1b455df63fe2517eea6247a 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 similarity index 74% rename from Library/Homebrew/test/test_integration_cmds_reinstall.rb rename to Library/Homebrew/test/test_reinstall.rb index ce1c0c919667df63c26fd8d73b05f88447b0ab14..d07a9605174660be27a85f5200f873a1b844aa2c 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 similarity index 88% rename from Library/Homebrew/test/test_integration_cmds_reinstall_pinned.rb rename to Library/Homebrew/test/test_reinstall_pinned.rb index dc4695e408964b7e440f8004df61220568aee19b..c9cb8a849fb980285e307c15c411ac673a49df0a 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 similarity index 65% rename from Library/Homebrew/test/test_integration_cmds_repository.rb rename to Library/Homebrew/test/test_repository.rb index a90dc1814aac587210cf2c497509730eddb36432..2029876ad7e56306e6ccbbaab181c191ce7be08a 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 similarity index 91% rename from Library/Homebrew/test/test_integration_cmds_search.rb rename to Library/Homebrew/test/test_search.rb index f85d1d67e40c930985bbf31f7e877fed590dfd4c..8310d1c2b2a7e3f618d1bf7cc77ae86f96732e22 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 similarity index 66% rename from Library/Homebrew/test/test_integration_cmds_services.rb rename to Library/Homebrew/test/test_services.rb index 043b5b0d6f81a8e71ec24e725adc94448ddcf641..b5ccb7c77886c1ec961c125fd48f5bdc9da7ad1e 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 similarity index 54% rename from Library/Homebrew/test/test_integration_cmds_sh.rb rename to Library/Homebrew/test/test_sh.rb index be9e119c524519c3d2108e87f92bb2615bd92307..449b7b5b3e95d35f8b6a889d8093ff0c282b1bb4 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 similarity index 83% rename from Library/Homebrew/test/test_integration_cmds_switch.rb rename to Library/Homebrew/test/test_switch.rb index 50b636d14a56a955bc40f3974304424c287fdca5..88fdf85b98cee9693aa44ea2400eaa8ad004d4e8 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 fafac252fa5e05672ea6a8b285b91e33371f14df..1396d0a0eb99f077c34dcab4a8df16e663f7ba09 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 similarity index 70% rename from Library/Homebrew/test/test_integration_cmds_tap_readme.rb rename to Library/Homebrew/test/test_tap_readme.rb index c1f53c42d251bb810e787a4093399684183a16c7..1181c3ffc51dec41cb0ac0fa201c12db7a13e0b4 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 similarity index 94% rename from Library/Homebrew/test/test_integration_cmds_test_formula.rb rename to Library/Homebrew/test/test_test_formula.rb index 4350fdbe9d06472b3f0990a662d4d9d1f379efe2..b3889d6a2f96bd9c21f33ba1a0b3c549f32d66af 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 similarity index 55% rename from Library/Homebrew/test/test_integration_cmds_uninstall.rb rename to Library/Homebrew/test/test_uninstall.rb index 6f82bedc771b03ef5314d5c9b5e5946b865ab280..050934238ea9c0fb85330d2496741f12e6ebce24 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 similarity index 60% rename from Library/Homebrew/test/test_integration_cmds_unlink.rb rename to Library/Homebrew/test/test_unlink.rb index b64cc81406591d3d87ab9cdb866b1c41e3923695..091bd8c45bae60f896cf72f980c7440a278c2aca 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 similarity index 78% rename from Library/Homebrew/test/test_integration_cmds_unlinkapps.rb rename to Library/Homebrew/test/test_unlinkapps.rb index 047f17a1da523547cf4c31be09f8734532b801bf..2de4e3ff8ae4ee8a7cd3b12fa8eda2285750eb10 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 similarity index 68% rename from Library/Homebrew/test/test_integration_cmds_unpack.rb rename to Library/Homebrew/test/test_unpack.rb index 1b6e97e52de56425e1db23e566affc9e98c8017a..de1452a297225966216e51de978237551921fb43 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 similarity index 68% rename from Library/Homebrew/test/test_integration_cmds_upgrade.rb rename to Library/Homebrew/test/test_upgrade.rb index 5eee33d56ba75b0acaf5b349ac7ac918ff7ef070..73618293bc8e88408df54412723c071118c6cf2e 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 similarity index 76% rename from Library/Homebrew/test/test_integration_cmds_uses.rb rename to Library/Homebrew/test/test_uses.rb index e5c0c0f770066a27c2f0d561259cb52c67ce3432..b0e79ef2d8dd1b73335a8a030d5123e4d555104d 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 0000000000000000000000000000000000000000..ca37e3567aebec5fe152360ab0d7bc53c5fce22d --- /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