test_cmd_audit: add resource placement test
This commit is contained in:
parent
557f6e33a9
commit
c6e0c9538f
@ -156,6 +156,23 @@ class FormulaAuditorTests < Homebrew::TestCase
|
|||||||
fa.problems
|
fa.problems
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_audit_file_strict_resource_placement
|
||||||
|
fa = formula_auditor "foo", <<-EOS.undent, :strict => true
|
||||||
|
class Foo < Formula
|
||||||
|
url "https://example.com/foo-1.0.tgz"
|
||||||
|
|
||||||
|
resource "foo2" do
|
||||||
|
url "https://example.com/foo-2.0.tgz"
|
||||||
|
end
|
||||||
|
|
||||||
|
depends_on "openssl"
|
||||||
|
end
|
||||||
|
EOS
|
||||||
|
fa.audit_file
|
||||||
|
assert_equal ["`depends_on` (line 8) should be put before `resource` (line 4)"],
|
||||||
|
fa.problems
|
||||||
|
end
|
||||||
|
|
||||||
def test_audit_file_strict_url_outside_of_stable_block
|
def test_audit_file_strict_url_outside_of_stable_block
|
||||||
fa = formula_auditor "foo", <<-EOS.undent, :strict => true
|
fa = formula_auditor "foo", <<-EOS.undent, :strict => true
|
||||||
class Foo < Formula
|
class Foo < Formula
|
||||||
|
Loading…
x
Reference in New Issue
Block a user