test_cmd_audit: add resource placement test

This commit is contained in:
Dominyk Tiller 2016-01-28 13:41:44 +00:00
parent 557f6e33a9
commit c6e0c9538f

View File

@ -156,6 +156,23 @@ class FormulaAuditorTests < Homebrew::TestCase
fa.problems
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
fa = formula_auditor "foo", <<-EOS.undent, :strict => true
class Foo < Formula