audit: a couple more tests

Closes Homebrew/homebrew#49404.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
Baptiste Fontaine 2016-02-21 22:47:50 +01:00
parent 3505509bae
commit 1208e26c74

View File

@ -321,4 +321,23 @@ class FormulaAuditorTests < Homebrew::TestCase
fa.audit_line 'ohai share/"foolibc++"', 3
assert_equal 'Use pkgshare instead of (share/"foolibc++")', fa.problems.shift
end
def test_audit_line_space_in_class_inheritance
fa = formula_auditor "foo", "class Foo<Formula; url '/foo-1.0.tgz'; end"
fa.audit_line "class Foo<Formula", 1
assert_equal "Use a space in class inheritance: class Foo < Formula",
fa.problems.shift
end
def test_audit_line_default_template
fa = formula_auditor "foo", "class Foo < Formula; url '/foo-1.0.tgz'; end"
fa.audit_line '# system "cmake", ".", *std_cmake_args', 3
assert_equal "Commented cmake call found",
fa.problems.shift
fa.audit_line "# PLEASE REMOVE", 3
assert_equal "Please remove default template comments",
fa.problems.shift
end
end