aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/test
diff options
context:
space:
mode:
authorDominyk Tiller2016-01-28 13:41:44 +0000
committerDominyk Tiller2016-01-31 00:39:29 +0000
commitc6e0c9538fdb2a5463bcb28eaa5586cebcb9000b (patch)
tree9148ae43fe6b459311f9f08f3a198a67645320ab /Library/Homebrew/test
parent557f6e33a9496513006a3ec69f9d3f3d0450e9e5 (diff)
downloadbrew-c6e0c9538fdb2a5463bcb28eaa5586cebcb9000b.tar.bz2
test_cmd_audit: add resource placement test
Diffstat (limited to 'Library/Homebrew/test')
-rw-r--r--Library/Homebrew/test/test_cmd_audit.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/test/test_cmd_audit.rb b/Library/Homebrew/test/test_cmd_audit.rb
index 118dba544..cc10cdee9 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