Add livecheck_find_versions_parameters tests

This commit is contained in:
Sam Ford 2025-02-21 21:35:08 -05:00
parent 0bb18b33b2
commit 749a7c846e
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -86,6 +86,22 @@ RSpec.describe Homebrew::Livecheck do
end end
end end
describe "::livecheck_find_versions_parameters" do
context "when provided with a strategy class" do
it "returns demodulized class name" do
page_match_parameters = T::Utils.signature_for_method(
Homebrew::Livecheck::Strategy::PageMatch.method(:find_versions),
).parameters.map(&:second)
# We run this twice with the same argument to exercise the caching logic
expect(livecheck.send(:livecheck_find_versions_parameters, Homebrew::Livecheck::Strategy::PageMatch))
.to eq(page_match_parameters)
expect(livecheck.send(:livecheck_find_versions_parameters, Homebrew::Livecheck::Strategy::PageMatch))
.to eq(page_match_parameters)
end
end
end
describe "::resolve_livecheck_reference" do describe "::resolve_livecheck_reference" do
context "when a formula/cask has a `livecheck` block without formula/cask methods" do context "when a formula/cask has a `livecheck` block without formula/cask methods" do
it "returns [nil, []]" do it "returns [nil, []]" do