formula_auditor_spec: add wheel resource test

Signed-off-by: William Woodruff <william@yossarian.net>
This commit is contained in:
William Woodruff 2024-07-14 13:19:36 -04:00
parent 1ef8aeea49
commit fdabfd15dc
No known key found for this signature in database

View File

@ -503,7 +503,7 @@ RSpec.describe Homebrew::FormulaAuditor do
end
describe "#audit_resource_name_matches_pypi_package_name_in_url" do
it "reports a problem if the resource name does not match the python package name" do
it "reports a problem if the resource name does not match the python sdist name" do
fa = formula_auditor "foo", <<~RUBY
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
@ -521,6 +521,25 @@ RSpec.describe Homebrew::FormulaAuditor do
expect(fa.problems.first[:message])
.to match("resource name should be `FooSomething` to match the PyPI package name")
end
it "reports a problem if the resource name does not match the python wheel name" do
fa = formula_auditor "foo", <<~RUBY
class Foo < Formula
url "https://brew.sh/foo-1.0.tgz"
sha256 "abc123"
homepage "https://brew.sh"
resource "Something" do
url "https://files.pythonhosted.org/packages/FooSomething-1.0.0-py3-none-any.whl"
sha256 "def456"
end
end
RUBY
fa.audit_specs
expect(fa.problems.first[:message])
.to match("resource name should be `FooSomething` to match the PyPI package name")
end
end
describe "#check_service_command" do