From c6e0c9538fdb2a5463bcb28eaa5586cebcb9000b Mon Sep 17 00:00:00 2001 From: Dominyk Tiller Date: Thu, 28 Jan 2016 13:41:44 +0000 Subject: [PATCH] test_cmd_audit: add resource placement test --- Library/Homebrew/test/test_cmd_audit.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Library/Homebrew/test/test_cmd_audit.rb b/Library/Homebrew/test/test_cmd_audit.rb index 118dba544b..cc10cdee95 100644 --- a/Library/Homebrew/test/test_cmd_audit.rb +++ b/Library/Homebrew/test/test_cmd_audit.rb @@ -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