Rename/merge test files.
This commit is contained in:
parent
cd677cf3ae
commit
d508b124a4
@ -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
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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",
|
||||
@ -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")
|
||||
8
Library/Homebrew/test/test_cache.rb
Normal file
8
Library/Homebrew/test/test_cache.rb
Normal file
@ -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
|
||||
@ -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)
|
||||
@ -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
|
||||
@ -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")
|
||||
8
Library/Homebrew/test/test_cellar.rb
Normal file
8
Library/Homebrew/test/test_cellar.rb
Normal file
@ -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
|
||||
@ -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)
|
||||
@ -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
|
||||
|
||||
@ -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")
|
||||
@ -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
|
||||
|
||||
@ -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")
|
||||
@ -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")
|
||||
@ -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}"
|
||||
@ -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"
|
||||
@ -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"
|
||||
|
||||
@ -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")
|
||||
@ -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"
|
||||
@ -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"
|
||||
|
||||
@ -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).
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
@ -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")
|
||||
@ -1,8 +0,0 @@
|
||||
require "integration_cmds_tests"
|
||||
|
||||
class IntegrationCommandTestCache < IntegrationCommandTests
|
||||
def test_cache
|
||||
assert_equal HOMEBREW_CACHE.to_s,
|
||||
cmd("--cache")
|
||||
end
|
||||
end
|
||||
@ -1,8 +0,0 @@
|
||||
require "integration_cmds_tests"
|
||||
|
||||
class IntegrationCommandTestCellar < IntegrationCommandTests
|
||||
def test_cellar
|
||||
assert_equal HOMEBREW_CELLAR.to_s,
|
||||
cmd("--cellar")
|
||||
end
|
||||
end
|
||||
@ -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
|
||||
@ -1,8 +0,0 @@
|
||||
require "integration_cmds_tests"
|
||||
|
||||
class IntegrationCommandTestCommands < IntegrationCommandTests
|
||||
def test_commands
|
||||
assert_match "Built-in commands",
|
||||
cmd("commands")
|
||||
end
|
||||
end
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -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
|
||||
@ -1,8 +0,0 @@
|
||||
require "integration_cmds_tests"
|
||||
|
||||
class IntegrationCommandTestPrefix < IntegrationCommandTests
|
||||
def test_prefix
|
||||
assert_equal HOMEBREW_PREFIX.to_s,
|
||||
cmd("--prefix")
|
||||
end
|
||||
end
|
||||
@ -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
|
||||
@ -1,8 +0,0 @@
|
||||
require "integration_cmds_tests"
|
||||
|
||||
class IntegrationCommandTestVersion < IntegrationCommandTests
|
||||
def test_version
|
||||
assert_match HOMEBREW_VERSION.to_s,
|
||||
cmd("--version")
|
||||
end
|
||||
end
|
||||
@ -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")
|
||||
@ -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"
|
||||
@ -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")
|
||||
|
||||
@ -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
|
||||
@ -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|
|
||||
@ -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
|
||||
@ -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"
|
||||
@ -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"
|
||||
@ -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"
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
8
Library/Homebrew/test/test_prefix.rb
Normal file
8
Library/Homebrew/test/test_prefix.rb
Normal file
@ -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
|
||||
@ -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)
|
||||
@ -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")
|
||||
|
||||
@ -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"]
|
||||
|
||||
@ -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")
|
||||
@ -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"
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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")
|
||||
@ -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"
|
||||
@ -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
|
||||
@ -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"))
|
||||
@ -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")
|
||||
@ -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
|
||||
|
||||
@ -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")
|
||||
@ -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",
|
||||
@ -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)
|
||||
@ -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"
|
||||
|
||||
@ -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"
|
||||
@ -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"
|
||||
|
||||
@ -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
|
||||
@ -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"
|
||||
8
Library/Homebrew/test/test_version.rb
Normal file
8
Library/Homebrew/test/test_version.rb
Normal file
@ -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
|
||||
Loading…
x
Reference in New Issue
Block a user