diff options
| author | Mike McQuaid | 2014-12-27 15:58:29 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-27 16:31:44 +0000 |
| commit | 6aab0df960ed3d6b765b8be9aa077955e6e6ee93 (patch) | |
| tree | a92182b98f25cb6b5cbb2076c58eb36600927430 /Library | |
| parent | 15ac5fb3ebc279ec1f7e4bb6090661c6de909340 (diff) | |
| download | homebrew-6aab0df960ed3d6b765b8be9aa077955e6e6ee93.tar.bz2 | |
audit (strict): check a test is present.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 69efcaf83..8c76d92a7 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 |
