mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Fix caveats when loading from the API
This commit is contained in:
parent
0ea9f5ec80
commit
15cf890ed7
@ -203,7 +203,7 @@ module Formulary
|
|||||||
|
|
||||||
@caveats_string = json_formula["caveats"]
|
@caveats_string = json_formula["caveats"]
|
||||||
def caveats
|
def caveats
|
||||||
@caveats_string
|
self.class.instance_variable_get(:@caveats_string)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -241,7 +241,7 @@ describe Formulary do
|
|||||||
"recommended_dependencies" => ["recommended_dep"],
|
"recommended_dependencies" => ["recommended_dep"],
|
||||||
"optional_dependencies" => ["optional_dep"],
|
"optional_dependencies" => ["optional_dep"],
|
||||||
"uses_from_macos" => ["uses_from_macos_dep"],
|
"uses_from_macos" => ["uses_from_macos_dep"],
|
||||||
"caveats" => "",
|
"caveats" => "example caveat string",
|
||||||
}.merge(extra_items),
|
}.merge(extra_items),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -276,6 +276,7 @@ describe Formulary do
|
|||||||
expect(formula.deps.count).to eq 5
|
expect(formula.deps.count).to eq 5
|
||||||
end
|
end
|
||||||
expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"]
|
expect(formula.uses_from_macos_elements).to eq ["uses_from_macos_dep"]
|
||||||
|
expect(formula.caveats).to eq "example caveat string"
|
||||||
expect {
|
expect {
|
||||||
formula.install
|
formula.install
|
||||||
}.to raise_error("Cannot build from source from abstract formula.")
|
}.to raise_error("Cannot build from source from abstract formula.")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user