audit: a couple more tests
Closes Homebrew/homebrew#49404. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
parent
3505509bae
commit
1208e26c74
@ -321,4 +321,23 @@ class FormulaAuditorTests < Homebrew::TestCase
|
|||||||
fa.audit_line 'ohai share/"foolibc++"', 3
|
fa.audit_line 'ohai share/"foolibc++"', 3
|
||||||
assert_equal 'Use pkgshare instead of (share/"foolibc++")', fa.problems.shift
|
assert_equal 'Use pkgshare instead of (share/"foolibc++")', fa.problems.shift
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user