mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Remove :final from Requirement#satisfied? sig
This commit is contained in:
parent
3b1d59d8c4
commit
ccfc8bfbe6
@ -60,8 +60,9 @@ class Requirement
|
|||||||
s
|
s
|
||||||
end
|
end
|
||||||
|
|
||||||
# Pass a block or boolean to the satisfy DSL method instead of overriding.
|
# Overriding {#satisfied?} is unsupported.
|
||||||
sig(:final) {
|
# Pass a block or boolean to the satisfy DSL method instead.
|
||||||
|
sig {
|
||||||
params(
|
params(
|
||||||
env: T.nilable(String),
|
env: T.nilable(String),
|
||||||
cc: T.nilable(String),
|
cc: T.nilable(String),
|
||||||
@ -82,8 +83,9 @@ class Requirement
|
|||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Pass a boolean to the fatal DSL method instead of overriding.
|
# Overriding {#fatal?} is unsupported.
|
||||||
sig(:final) { returns(T::Boolean) }
|
# Pass a boolean to the fatal DSL method instead.
|
||||||
|
sig { returns(T::Boolean) }
|
||||||
def fatal?
|
def fatal?
|
||||||
self.class.fatal || false
|
self.class.fatal || false
|
||||||
end
|
end
|
||||||
|
@ -59,17 +59,6 @@ RSpec.describe Requirement do
|
|||||||
describe "#fatal is omitted" do
|
describe "#fatal is omitted" do
|
||||||
it { is_expected.not_to be_fatal }
|
it { is_expected.not_to be_fatal }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "in subclasses" do
|
|
||||||
it "raises an error when instantiated" do
|
|
||||||
expect do
|
|
||||||
Class.new(described_class) do
|
|
||||||
def fatal? = false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
.to raise_error(RuntimeError, /\AThe method `fatal\?` on #{described_class.name} was declared as final/)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#satisfied?" do
|
describe "#satisfied?" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user