Move Cask specs into brew tests.
This commit is contained in:
parent
67ec76d149
commit
9fc6c7b2be
@ -26,18 +26,6 @@ cask_root.cd do
|
|||||||
upload_coverage = ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
|
upload_coverage = ENV["CODECOV_TOKEN"] || ENV["TRAVIS"]
|
||||||
end
|
end
|
||||||
|
|
||||||
run_tests "parallel_rspec", Dir["spec/**/*_spec.rb"], %w[
|
|
||||||
--color
|
|
||||||
--require spec_helper
|
|
||||||
--format progress
|
|
||||||
--format ParallelTests::RSpec::RuntimeLogger
|
|
||||||
--out tmp/parallel_runtime_rspec.log
|
|
||||||
]
|
|
||||||
|
|
||||||
unless $CHILD_STATUS.success?
|
|
||||||
Homebrew.failed = true
|
|
||||||
end
|
|
||||||
|
|
||||||
if upload_coverage
|
if upload_coverage
|
||||||
puts "Submitting Codecov coverage..."
|
puts "Submitting Codecov coverage..."
|
||||||
system "bundle", "exec", "spec/upload_coverage.rb"
|
system "bundle", "exec", "spec/upload_coverage.rb"
|
||||||
|
|||||||
@ -18,6 +18,8 @@ require "test/support/helper/shutup"
|
|||||||
require "test/support/helper/fixtures"
|
require "test/support/helper/fixtures"
|
||||||
require "test/support/helper/formula"
|
require "test/support/helper/formula"
|
||||||
require "test/support/helper/mktmpdir"
|
require "test/support/helper/mktmpdir"
|
||||||
|
|
||||||
|
require "test/support/helper/spec/shared_context/homebrew_cask" if OS.mac?
|
||||||
require "test/support/helper/spec/shared_context/integration_test"
|
require "test/support/helper/spec/shared_context/integration_test"
|
||||||
|
|
||||||
TEST_DIRECTORIES = [
|
TEST_DIRECTORIES = [
|
||||||
|
|||||||
@ -1,7 +1,3 @@
|
|||||||
$LOAD_PATH.unshift(File.expand_path("#{ENV["HOMEBREW_REPOSITORY"]}/Library/Homebrew"))
|
|
||||||
require "test/spec_helper"
|
|
||||||
|
|
||||||
# add Homebrew-Cask to load path
|
|
||||||
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
$LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.join("cask", "lib").to_s)
|
||||||
|
|
||||||
require "hbc"
|
require "hbc"
|
||||||
@ -20,18 +16,17 @@ HOMEBREW_CASK_DIRS = [
|
|||||||
:binarydir,
|
:binarydir,
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
RSpec.configure do |config|
|
RSpec.shared_context "Homebrew-Cask" do
|
||||||
config.around(:each) do |example|
|
around(:each) do |example|
|
||||||
begin
|
begin
|
||||||
dirs = HOMEBREW_CASK_DIRS.map { |dir|
|
dirs = HOMEBREW_CASK_DIRS.map do |dir|
|
||||||
Pathname.new(TEST_TMPDIR).join("cask-#{dir}").tap { |path|
|
Pathname.new(TEST_TMPDIR).join("cask-#{dir}").tap do |path|
|
||||||
path.mkpath
|
path.mkpath
|
||||||
Hbc.public_send("#{dir}=", path)
|
Hbc.public_send("#{dir}=", path)
|
||||||
}
|
end
|
||||||
}
|
end
|
||||||
|
|
||||||
Hbc.default_tap = Tap.fetch("caskroom", "spec").tap do |tap|
|
Hbc.default_tap = Tap.fetch("caskroom", "spec").tap do |tap|
|
||||||
# link test casks
|
|
||||||
FileUtils.mkdir_p tap.path.dirname
|
FileUtils.mkdir_p tap.path.dirname
|
||||||
FileUtils.ln_sf TEST_FIXTURE_DIR.join("cask"), tap.path
|
FileUtils.ln_sf TEST_FIXTURE_DIR.join("cask"), tap.path
|
||||||
end
|
end
|
||||||
@ -39,6 +34,12 @@ RSpec.configure do |config|
|
|||||||
example.run
|
example.run
|
||||||
ensure
|
ensure
|
||||||
FileUtils.rm_rf dirs
|
FileUtils.rm_rf dirs
|
||||||
|
Hbc.default_tap.path.unlink
|
||||||
|
FileUtils.rm_rf Hbc.default_tap.path.parent
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
RSpec.configure do |config|
|
||||||
|
config.include_context "Homebrew-Cask", :cask
|
||||||
|
end
|
||||||
Loading…
x
Reference in New Issue
Block a user