Move all remaining fixtures to test/support/fixtures.
@ -8,15 +8,15 @@ end
|
||||
|
||||
# add Homebrew to load path
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
|
||||
|
||||
require "global"
|
||||
|
||||
# add Homebrew-Cask to load path
|
||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||
|
||||
require "test/helper/env"
|
||||
require "test/helper/shutup"
|
||||
require "test/support/helper/env"
|
||||
require "test/support/helper/shutup"
|
||||
|
||||
Pathname.glob(HOMEBREW_LIBRARY_PATH.join("cask", "spec", "support", "*.rb")).each(&method(:require))
|
||||
|
||||
|
||||
@ -6,15 +6,15 @@ require "simplecov" if ENV["HOMEBREW_TESTS_COVERAGE"]
|
||||
|
||||
# add Homebrew to load path
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/lib"))
|
||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew/test/support/lib"))
|
||||
|
||||
require "global"
|
||||
|
||||
# add Homebrew-Cask to load path
|
||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||
|
||||
require "test/helper/env"
|
||||
require "test/helper/shutup"
|
||||
require "test/support/helper/env"
|
||||
require "test/support/helper/shutup"
|
||||
include Test::Helper::Env
|
||||
include Test::Helper::Shutup
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 43 B After Width: | Height: | Size: 43 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 288 B After Width: | Height: | Size: 288 B |
|
Before Width: | Height: | Size: 82 B After Width: | Height: | Size: 82 B |
|
Before Width: | Height: | Size: 264 B After Width: | Height: | Size: 264 B |
@ -1,7 +1,7 @@
|
||||
class Testball < Formula
|
||||
def initialize(name = "testball", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
|
||||
self.class.instance_eval do
|
||||
stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
stable.sha256 TESTBALL_SHA256
|
||||
end
|
||||
super
|
||||
@ -1,11 +1,11 @@
|
||||
class TestballBottle < Formula
|
||||
def initialize(name = "testball_bottle", path = Pathname.new(__FILE__).expand_path, spec = :stable, alias_path: nil)
|
||||
self.class.instance_eval do
|
||||
stable.url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
stable.url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
stable.sha256 TESTBALL_SHA256
|
||||
stable.bottle do
|
||||
cellar :any_skip_relocation
|
||||
root_url "file://#{File.expand_path("..", __FILE__)}/bottles"
|
||||
root_url "file://#{TEST_FIXTURE_DIR}/bottles"
|
||||
sha256 "9abc8ce779067e26556002c4ca6b9427b9874d25f0cafa7028e05b5c5c410cb4" => Utils::Bottles.tag
|
||||
end
|
||||
cxxstdlib_check :skip
|
||||
@ -1,7 +1,7 @@
|
||||
class Testbottest < Formula
|
||||
desc "Minimal C program and Makefile used for testing Homebrew."
|
||||
homepage "https://github.com/Homebrew/brew"
|
||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testbottest-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testbottest-0.1.tbz"
|
||||
sha256 "78b54d8f31585c9773bed12b4aa4ab2ce458ebd044b9406cb24d40aa5107f082"
|
||||
|
||||
def install
|
||||
@ -1,5 +1,4 @@
|
||||
require "bundler"
|
||||
require "testing_env"
|
||||
require "fileutils"
|
||||
require "pathname"
|
||||
require "formula"
|
||||
@ -21,6 +20,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
|
||||
HOMEBREW_LOCK_DIR.children,
|
||||
HOMEBREW_LOGS.children,
|
||||
HOMEBREW_TEMP.children,
|
||||
HOMEBREW_PREFIX/".git",
|
||||
HOMEBREW_PREFIX/"bin",
|
||||
HOMEBREW_PREFIX/"share",
|
||||
HOMEBREW_PREFIX/"opt",
|
||||
@ -59,7 +59,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
|
||||
env = args.last.is_a?(Hash) ? args.pop : {}
|
||||
cmd_args = %W[
|
||||
-W0
|
||||
-I#{HOMEBREW_LIBRARY_PATH}/test/lib
|
||||
-I#{HOMEBREW_LIBRARY_PATH}/test/support/lib
|
||||
-rconfig
|
||||
]
|
||||
if ENV["HOMEBREW_TESTS_COVERAGE"]
|
||||
@ -125,7 +125,7 @@ class IntegrationCommandTestCase < Homebrew::TestCase
|
||||
content = <<-EOS.undent
|
||||
desc "Some test"
|
||||
homepage "https://example.com/#{name}"
|
||||
url "file://#{File.expand_path("../..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
sha256 "#{TESTBALL_SHA256}"
|
||||
|
||||
option "with-foo", "Build with foo"
|
||||
@ -195,6 +195,6 @@ class IntegrationCommandTestCase < Homebrew::TestCase
|
||||
end
|
||||
|
||||
def testball
|
||||
"#{File.expand_path("../..", __FILE__)}/testball.rb"
|
||||
"#{TEST_FIXTURE_DIR}/testball.rb"
|
||||
end
|
||||
end
|
||||
@ -14,7 +14,7 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
|
||||
end
|
||||
|
||||
# Paths pointing into the Homebrew code base that persist across test runs
|
||||
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../..", __FILE__))
|
||||
HOMEBREW_LIBRARY_PATH = Pathname.new(File.expand_path("../../../..", __FILE__))
|
||||
HOMEBREW_SHIMS_PATH = HOMEBREW_LIBRARY_PATH.parent+"Homebrew/shims"
|
||||
HOMEBREW_LOAD_PATH = [File.expand_path("..", __FILE__), HOMEBREW_LIBRARY_PATH].join(":")
|
||||
|
||||
@ -31,7 +31,7 @@ HOMEBREW_CELLAR = HOMEBREW_PREFIX.parent+"cellar"
|
||||
HOMEBREW_LOGS = HOMEBREW_PREFIX.parent+"logs"
|
||||
HOMEBREW_TEMP = HOMEBREW_PREFIX.parent+"temp"
|
||||
|
||||
TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH.join("test", "fixtures")
|
||||
TEST_FIXTURE_DIR = HOMEBREW_LIBRARY_PATH.join("test", "support", "fixtures")
|
||||
|
||||
TESTBALL_SHA1 = "be478fd8a80fe7f29196d6400326ac91dad68c37".freeze
|
||||
TESTBALL_SHA256 = "91e3f7930c98d7ccfb288e115ed52d06b0e5bc16fec7dce8bdda86530027067b".freeze
|
||||
@ -1,6 +1,7 @@
|
||||
require "testing_env"
|
||||
require "extend/ENV"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestEnv < IntegrationCommandTestCase
|
||||
def test_env
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestAnalytics < IntegrationCommandTestCase
|
||||
def test_analytics
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestBottle < IntegrationCommandTestCase
|
||||
def test_bottle
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestBundle < IntegrationCommandTestCase
|
||||
def test_bundle
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCacheFormula < IntegrationCommandTestCase
|
||||
def test_cache_formula
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCache < IntegrationCommandTestCase
|
||||
def test_cache
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCask < IntegrationCommandTestCase
|
||||
def test_cask
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCat < IntegrationCommandTestCase
|
||||
def test_cat
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCellarFormula < IntegrationCommandTestCase
|
||||
def test_cellar_formula
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCellar < IntegrationCommandTestCase
|
||||
def test_cellar
|
||||
|
||||
@ -12,7 +12,7 @@ class ChecksumVerificationTests < Homebrew::TestCase
|
||||
|
||||
def formula(&block)
|
||||
super do
|
||||
url "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
instance_eval(&block)
|
||||
end
|
||||
end
|
||||
|
||||
@ -17,8 +17,8 @@ class CleanerTests < Homebrew::TestCase
|
||||
def test_clean_file
|
||||
@f.bin.mkpath
|
||||
@f.lib.mkpath
|
||||
cp "#{TEST_DIRECTORY}/mach/a.out", @f.bin
|
||||
cp Dir["#{TEST_DIRECTORY}/mach/*.dylib"], @f.lib
|
||||
cp "#{TEST_FIXTURE_DIR}/mach/a.out", @f.bin
|
||||
cp Dir["#{TEST_FIXTURE_DIR}/mach/*.dylib"], @f.lib
|
||||
|
||||
Cleaner.new(@f).clean
|
||||
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
require "testing_env"
|
||||
require "testball"
|
||||
require "test/support/fixtures/testball"
|
||||
require "cleanup"
|
||||
require "fileutils"
|
||||
require "pathname"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCleanup < IntegrationCommandTestCase
|
||||
def test_cleanup
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCommand < IntegrationCommandTestCase
|
||||
def test_command
|
||||
|
||||
@ -2,7 +2,8 @@ require "testing_env"
|
||||
require "cmd/command"
|
||||
require "cmd/commands"
|
||||
require "fileutils"
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCommands < IntegrationCommandTestCase
|
||||
def test_commands
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestConfig < IntegrationCommandTestCase
|
||||
def test_config
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCreate < IntegrationCommandTestCase
|
||||
def test_create
|
||||
url = "file://#{TEST_DIRECTORY}/tarballs/testball-0.1.tbz"
|
||||
url = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
cmd("create", url, "HOMEBREW_EDITOR" => "/bin/cat")
|
||||
|
||||
formula_file = CoreTap.new.formula_dir/"testball.rb"
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestCustomCommand < IntegrationCommandTestCase
|
||||
def test_custom_command
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestDeps < IntegrationCommandTestCase
|
||||
def test_deps
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestDesc < IntegrationCommandTestCase
|
||||
def test_desc
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestDoctor < IntegrationCommandTestCase
|
||||
def test_doctor
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestEdit < IntegrationCommandTestCase
|
||||
def test_edit
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestFetch < IntegrationCommandTestCase
|
||||
def test_fetch
|
||||
|
||||
@ -3,8 +3,8 @@ require "formula"
|
||||
require "formula_installer"
|
||||
require "keg"
|
||||
require "tab"
|
||||
require "testball"
|
||||
require "testball_bottle"
|
||||
require "test/support/fixtures/testball"
|
||||
require "test/support/fixtures/testball_bottle"
|
||||
|
||||
class InstallBottleTests < Homebrew::TestCase
|
||||
def temporary_bottle_install(formula)
|
||||
|
||||
@ -3,8 +3,8 @@ require "formula"
|
||||
require "formula_installer"
|
||||
require "keg"
|
||||
require "tab"
|
||||
require "testball"
|
||||
require "testball_bottle"
|
||||
require "test/support/fixtures/testball"
|
||||
require "test/support/fixtures/testball_bottle"
|
||||
|
||||
class InstallTests < Homebrew::TestCase
|
||||
def temporary_install(formula)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
require "testing_env"
|
||||
require "testball"
|
||||
require "test/support/fixtures/testball"
|
||||
require "formula"
|
||||
|
||||
class FormulaTests < Homebrew::TestCase
|
||||
|
||||
@ -18,11 +18,11 @@ class FormularyFactoryTest < Homebrew::TestCase
|
||||
def setup
|
||||
@name = "testball_bottle"
|
||||
@path = CoreTap.new.formula_dir/"#{@name}.rb"
|
||||
@bottle_dir = Pathname.new("#{TEST_DIRECTORY}/bottles")
|
||||
@bottle_dir = Pathname.new("#{TEST_FIXTURE_DIR}/bottles")
|
||||
@bottle = @bottle_dir/"testball_bottle-0.1.#{Utils::Bottles.tag}.bottle.tar.gz"
|
||||
@path.write <<-EOS.undent
|
||||
class #{Formulary.class_s(@name)} < Formula
|
||||
url "file://#{File.expand_path("..", __FILE__)}/tarballs/testball-0.1.tbz"
|
||||
url "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1.tbz"
|
||||
sha256 TESTBALL_SHA256
|
||||
|
||||
bottle do
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
require "helper/integration_command_test_case"
|
||||
require "testing_env"
|
||||
require "test/support/helper/integration_command_test_case"
|
||||
|
||||
class IntegrationCommandTestHelp < IntegrationCommandTestCase
|
||||
def test_help
|
||||
|
||||