From 6cd9daffdf48dfa733640a302e20fe0953c465a6 Mon Sep 17 00:00:00 2001 From: Douglas Eichelberger Date: Tue, 25 Feb 2025 08:59:53 -0800 Subject: [PATCH] Fix return type of Formula.build --- Library/Homebrew/formula.rb | 2 +- Library/Homebrew/test/formula_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 020cd11825..db92cf8c74 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -3703,7 +3703,7 @@ class Formula sig { params(block: T.proc.bind(BottleSpecification).void).void } def bottle(&block) = stable.bottle(&block) - sig { returns(String) } + sig { returns(BuildOptions) } def build = stable.build # Get the `BUILD_FLAGS` from the formula's namespace set in `Formulary::load_formula`. diff --git a/Library/Homebrew/test/formula_spec.rb b/Library/Homebrew/test/formula_spec.rb index da58f08b6b..9d404f4b20 100644 --- a/Library/Homebrew/test/formula_spec.rb +++ b/Library/Homebrew/test/formula_spec.rb @@ -549,6 +549,7 @@ RSpec.describe Formula do expect(f.homepage).to eq("https://brew.sh") expect(f.version).to eq(Version.new("0.1")) expect(f).to be_stable + expect(f.build).to be_a(BuildOptions) expect(f.stable.version).to eq(Version.new("0.1")) expect(f.head.version).to eq(Version.new("HEAD")) end