rubocops: test whitelists.

This commit is contained in:
Mike McQuaid 2020-04-11 14:22:36 +01:00
parent 45908d8ff2
commit 56c02485e0
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
7 changed files with 20 additions and 1 deletions

View File

@ -26,4 +26,6 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do
RUBY
end
end
include_examples "formulae exist", described_class::WHITELIST
end

View File

@ -860,4 +860,6 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do
RUBY
end
end
include_examples "formulae exist", described_class::MAKE_CHECK_WHITELIST
end

View File

@ -218,6 +218,8 @@ describe RuboCop::Cop::FormulaAudit::Urls do
RUBY
end
end
include_examples "formulae exist", described_class::BINARY_BOOTSTRAP_FORMULA_URLS_WHITELIST
end
describe RuboCop::Cop::FormulaAudit::PyPiUrls do

View File

@ -16,4 +16,6 @@ describe RuboCop::Cop::FormulaAudit::UsesFromMacos do
end
RUBY
end
include_examples "formulae exist", described_class::ALLOWED_USES_FROM_MACOS_DEPS
end

View File

@ -52,6 +52,7 @@ require "test/support/helper/output_as_tty"
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_examples/formulae_exist"
TEST_DIRECTORIES = [
CoreTap.instance.path/"Formula",

View File

@ -0,0 +1,10 @@
# frozen_string_literal: true
shared_examples "formulae exist" do |array|
array.each do |f|
it "#{f} formula exists" do
formula_path = Pathname("#{HOMEBREW_LIBRARY_PATH}/../Taps/homebrew/homebrew-core/Formula/#{f}.rb")
expect(formula_path.exist?).to be true
end
end
end

View File

@ -17,7 +17,7 @@ TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k|
end.freeze
# Paths pointing into the Homebrew code base that persist across test runs
HOMEBREW_SHIMS_PATH = (HOMEBREW_LIBRARY_PATH.parent/"Homebrew/shims").freeze
HOMEBREW_SHIMS_PATH = (HOMEBREW_LIBRARY_PATH/"shims").freeze
require "extend/git_repository"