diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 69efcaf8327d37180f7b969d83880b34d381bd32..8c76d92a75025e88c8abcc78457d1d45daa48a1f 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -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