Improve style
This commit is contained in:
parent
7ff2382d74
commit
e191dbfb9e
@ -81,16 +81,16 @@ module Homebrew
|
||||
testing_formulae.any? do |formula|
|
||||
# If the formula has a platform/arch/macOS version requirement, then its
|
||||
# dependents don't need to be tested if these requirements are not satisfied.
|
||||
next false if reject_platform && formula.method(:"#{reject_platform}_only?").call
|
||||
next false if reject_arch && formula.method(:"#{reject_arch}_only?").call
|
||||
next false if reject_platform && formula.send(:"#{reject_platform}_only?")
|
||||
next false if reject_arch && formula.send(:"#{reject_arch}_only?")
|
||||
next false if select_macos_version && !formula.compatible_with?(select_macos_version)
|
||||
|
||||
compatible_dependents = formula.dependents.dup
|
||||
|
||||
compatible_dependents.reject! { |dependent_f| dependent_f.method(:"#{reject_arch}_only?").call } if reject_arch
|
||||
compatible_dependents.reject! { |dependent_f| dependent_f.send(:"#{reject_arch}_only?")} if reject_arch
|
||||
|
||||
if reject_platform
|
||||
compatible_dependents.reject! { |dependent_f| dependent_f.method(:"#{reject_platform}_only?").call }
|
||||
compatible_dependents.reject! { |dependent_f| dependent_f.send(:"#{reject_platform}_only?") }
|
||||
end
|
||||
|
||||
if select_macos_version
|
||||
@ -129,9 +129,9 @@ module Homebrew
|
||||
|
||||
compatible_formulae = formulae.dup
|
||||
|
||||
compatible_formulae.reject! { |formula| formula.method(:"#{reject_arch}_only?").call } if reject_arch
|
||||
compatible_formulae.reject! { |formula| formula.send(:"#{reject_platform}_only?") } if reject_platform
|
||||
compatible_formulae.reject! { |formula| formula.send(:"#{reject_arch}_only?") } if reject_arch
|
||||
compatible_formulae.select! { |formula| formula.compatible_with?(select_macos_version) } if select_macos_version
|
||||
compatible_formulae.reject! { |formula| formula.method(:"#{reject_platform}_only?").call } if reject_platform
|
||||
|
||||
compatible_formulae.present?
|
||||
end
|
||||
|
||||
@ -16,7 +16,7 @@ describe "brew determine-test-runners" do
|
||||
let(:arm64_runners) { all_runners - intel_runners }
|
||||
let(:macos_runners) { all_runners - [linux_runner] }
|
||||
# We need to make sure we write to a different path for each example.
|
||||
let(:github_output) { "#{TEST_TMPDIR}/github_output#{TestRunnerTestHelper.new.number}" }
|
||||
let(:github_output) { "#{TEST_TMPDIR}/github_output#{DetermineRunnerTestHelper.new.number}" }
|
||||
let(:ephemeral_suffix) { "-12345-1" }
|
||||
let(:runner_env) do
|
||||
{
|
||||
@ -158,7 +158,7 @@ def get_runners(file)
|
||||
.sort
|
||||
end
|
||||
|
||||
class TestRunnerTestHelper
|
||||
class DetermineRunnerTestHelper
|
||||
@instances = 0
|
||||
|
||||
class << self
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user