diff --git a/Library/Homebrew/test/rubocops/conflicts_spec.rb b/Library/Homebrew/test/rubocops/conflicts_spec.rb index db8fa42e57e0231466f9547558fa7260b9341aad..43fe3b512447604563b967a9e350a31cb9cc82ad 100644 --- a/Library/Homebrew/test/rubocops/conflicts_spec.rb +++ b/Library/Homebrew/test/rubocops/conflicts_spec.rb @@ -26,4 +26,6 @@ describe RuboCop::Cop::FormulaAudit::Conflicts do RUBY end end + + include_examples "formulae exist", described_class::WHITELIST end diff --git a/Library/Homebrew/test/rubocops/lines_spec.rb b/Library/Homebrew/test/rubocops/lines_spec.rb index 7b06f52ff9794819c335f24848bd6533fb47839f..6b6516134f40e90ae3e6260765bd6bfe9f71037e 100644 --- a/Library/Homebrew/test/rubocops/lines_spec.rb +++ b/Library/Homebrew/test/rubocops/lines_spec.rb @@ -860,4 +860,6 @@ describe RuboCop::Cop::FormulaAudit::Miscellaneous do RUBY end end + + include_examples "formulae exist", described_class::MAKE_CHECK_WHITELIST end diff --git a/Library/Homebrew/test/rubocops/urls_spec.rb b/Library/Homebrew/test/rubocops/urls_spec.rb index c82bdd3a333ec445c40609982a28c484469803a4..c3a547f435424ed006142fda226865c65217f0c4 100644 --- a/Library/Homebrew/test/rubocops/urls_spec.rb +++ b/Library/Homebrew/test/rubocops/urls_spec.rb @@ -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 diff --git a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb index 35f27cc92063ea0b6c2ed34a38db27f4a183afa1..d74cb57d27680f2627ad91521410082075c5fbf1 100644 --- a/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb +++ b/Library/Homebrew/test/rubocops/uses_from_macos_spec.rb @@ -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 diff --git a/Library/Homebrew/test/spec_helper.rb b/Library/Homebrew/test/spec_helper.rb index 2fc3c960b1500a6d2998f6b8e2564ad8699253ed..65490fddfa162eefefe6c342489b6d7c5d6743d9 100644 --- a/Library/Homebrew/test/spec_helper.rb +++ b/Library/Homebrew/test/spec_helper.rb @@ -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", diff --git a/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb b/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb new file mode 100644 index 0000000000000000000000000000000000000000..57a6560c72ab7ca0afcb21f679808e1818d14428 --- /dev/null +++ b/Library/Homebrew/test/support/helper/spec/shared_examples/formulae_exist.rb @@ -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 diff --git a/Library/Homebrew/test/support/lib/config.rb b/Library/Homebrew/test/support/lib/config.rb index b9cb738c956ec6cf4def770efe70bb4d6f480746..a34a660740c20b762c5c6456a3cc2e76c897ba6e 100644 --- a/Library/Homebrew/test/support/lib/config.rb +++ b/Library/Homebrew/test/support/lib/config.rb @@ -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"