Skip to content
Snippets Groups Projects
Commit f3a5a834 authored by Mike McQuaid's avatar Mike McQuaid
Browse files

audit (strict): check a test is present.

parent d263c73c
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,10 @@ class FormulaText
def has_trailing_newline?
/\Z\n/ =~ @text
end
def has_test?
@text.include? "test do"
end
end
class FormulaAuditor
......@@ -104,6 +108,12 @@ class FormulaAuditor
unless text.has_trailing_newline?
problem "File should end with a newline"
end
if @strict
unless text.has_test?
problem "A `test do` test block should be added"
end
end
end
@@aliases ||= Formula.aliases
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment