Fix tests

This commit is contained in:
Douglas Eichelberger 2025-02-17 14:17:08 -08:00 committed by Douglas Eichelberger
parent beeb0b8f6d
commit ca8759605c
No known key found for this signature in database
GPG Key ID: F90193CBD547EB81
4 changed files with 5 additions and 21 deletions

View File

@ -3202,9 +3202,7 @@ class Formula
# Returns the prefix for a given formula version number.
sig { params(version: T.any(String, Pathname, PkgVersion)).returns(Pathname) }
def versioned_prefix(version)
rack/version.to_s
end
def versioned_prefix(version) = rack/version.to_s
sig {
params(
@ -3401,7 +3399,6 @@ class Formula
# ]
# ```
#
# @!attribute [w] license
# @see https://docs.brew.sh/License-Guidelines Homebrew License Guidelines
# @see https://spdx.github.io/spdx-spec/latest/annexes/spdx-license-expressions/ SPDX license expression guide
# @api public
@ -3628,12 +3625,10 @@ class Formula
# revision: "db8e4de5b2d6653f66aea53094624468caad15d2"
# ```
#
# @!attribute [w] url
# @api public
sig { params(val: String, specs: T::Hash[Symbol, T.any(String, Symbol)]).void }
def url(val, specs = {}) = stable.url(val, specs)
# @!attribute [w] version
# The version string for the {.stable} version of the formula.
# The version is autodetected from the URL and/or tag so only needs to be
# declared if it cannot be autodetected correctly.
@ -3645,10 +3640,9 @@ class Formula
# ```
#
# @api public
sig { params(val: T.nilable(String)).void }
sig { params(val: T.nilable(String)).returns(T.nilable(Version)) }
def version(val = nil) = stable.version(val)
# @!attribute [w] mirror
# Additional URLs for the {.stable} version of the formula.
# These are only used if the {.url} fails to download. It's optional and
# there can be more than one. Generally we add them when the main {.url}
@ -3666,7 +3660,6 @@ class Formula
sig { params(val: String).void }
def mirror(val) = stable.mirror(val)
# @!attribute [w] sha256
# @scope class
# To verify the cached download's integrity and security we verify the
# SHA-256 hash matches what we've declared in the {Formula}. To quickly fill
@ -3723,7 +3716,6 @@ class Formula
mod.const_get(:BUILD_FLAGS)
end
# @!attribute [w] stable
# Allows adding {.depends_on} and {Patch}es just to the {.stable} {SoftwareSpec}.
# This is required instead of using a conditional.
# It is preferable to also pull the {url} and {sha256= sha256} into the block if one is added.
@ -3879,7 +3871,7 @@ class Formula
# ```
#
# @api public
sig { params(dep: T.any(String, Symbol, T::Hash[String, T.untyped])).void }
sig { params(dep: T.any(String, Symbol, T::Hash[String, T.untyped], T::Class[Requirement])).void }
def depends_on(dep)
specs.each { |spec| spec.depends_on(dep) }
end
@ -3900,7 +3892,6 @@ class Formula
specs.each { |spec| spec.uses_from_macos(dep, bounds) }
end
# @!attribute [w] option
# Options can be used as arguments to `brew install`.
# To switch features on/off: `"with-something"` or `"with-otherthing"`.
# To use other software: `"with-other-software"` or `"without-foo"`.
@ -3932,7 +3923,6 @@ class Formula
specs.each { |spec| spec.option(name, description) }
end
# @!attribute [w] deprecated_option
# Deprecated options are used to rename options and migrate users who used
# them to newer ones. They are mostly used for migrating non-`with` options
# (e.g. `enable-debug`) to `with` options (e.g. `with-debug`).
@ -4115,7 +4105,7 @@ class Formula
# ```
#
# @api public
sig { params(compiler: T.any(Symbol, T::Hash[Symbol, String]), block: T.proc.void).void }
sig { params(compiler: T.any(Symbol, T::Hash[Symbol, String]), block: T.nilable(T.proc.void)).void }
def fails_with(compiler, &block)
specs.each { |spec| spec.fails_with(compiler, &block) }
end
@ -4191,7 +4181,6 @@ class Formula
# end
# ```
#
# @!attribute [w] livecheck
# @api public
sig { params(block: T.nilable(T.proc.bind(Livecheck).returns(T.untyped))).returns(T.untyped) }
def livecheck(&block)
@ -4214,7 +4203,6 @@ class Formula
# end
# ```
#
# @!attribute [w] service
# @api public
sig { params(block: T.nilable(T.proc.returns(T.untyped))).returns(T.nilable(T.proc.returns(T.untyped))) }
def service(&block)
@ -4252,7 +4240,7 @@ class Formula
params(
only_if: T.nilable(Symbol),
block: T.nilable(T.proc.params(arg0: T.untyped).returns(T.any(T::Boolean, Symbol))),
).returns(T.any(T::Boolean, Symbol))
).void
}
def pour_bottle?(only_if: nil, &block)
@pour_bottle_check = T.let(PourBottleCheck.new(self), T.nilable(PourBottleCheck))

View File

@ -46,7 +46,6 @@ RSpec.describe Language::Node::Shebang do
describe "#detected_node_shebang" do
it "can be used to replace Node shebangs" do
allow(Formulary).to receive(:factory)
allow(Formulary).to receive(:factory).with(f[:node18].name).and_return(f[:node18])
Utils::Shebang.rewrite_shebang described_class.detected_node_shebang(f[:versioned_node_dep]), file.path

View File

@ -45,7 +45,6 @@ RSpec.describe Language::Perl::Shebang do
describe "#detected_perl_shebang" do
it "can be used to replace Perl shebangs when depends_on \"perl\" is used" do
allow(Formulary).to receive(:factory)
allow(Formulary).to receive(:factory).with(f[:perl].name).and_return(f[:perl])
Utils::Shebang.rewrite_shebang described_class.detected_perl_shebang(f[:depends_on]), file.path
@ -58,7 +57,6 @@ RSpec.describe Language::Perl::Shebang do
end
it "can be used to replace Perl shebangs when uses_from_macos \"perl\" is used" do
allow(Formulary).to receive(:factory)
allow(Formulary).to receive(:factory).with(f[:perl].name).and_return(f[:perl])
Utils::Shebang.rewrite_shebang described_class.detected_perl_shebang(f[:uses_from_macos]), file.path

View File

@ -46,7 +46,6 @@ RSpec.describe Language::Python::Shebang do
describe "#detected_python_shebang" do
it "can be used to replace Python shebangs" do
allow(Formulary).to receive(:factory)
allow(Formulary).to receive(:factory).with(f[:python311].name).and_return(f[:python311])
Utils::Shebang.rewrite_shebang(
described_class.detected_python_shebang(f[:versioned_python_dep], use_python_from_path: false), file.path