diff options
| author | Mike McQuaid | 2014-12-27 20:46:01 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2014-12-27 20:46:01 +0000 |
| commit | 8458540afbee9376491471a5feaf10d5823274c8 (patch) | |
| tree | 3a239596fc1ff172aa649cabab7e4a2d9e44de89 /Library | |
| parent | 13239276f00f3036081ee4b2b8262a287342f060 (diff) | |
| download | brew-8458540afbee9376491471a5feaf10d5823274c8.tar.bz2 | |
audit: simplify test defined check.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/audit.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index d4bc0be20..79fe0a8cf 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -41,7 +41,6 @@ class FormulaText @text = path.open("rb", &:read) end - def without_patch @text.split("\n__END__").first end @@ -57,10 +56,6 @@ class FormulaText def has_trailing_newline? /\Z\n/ =~ @text end - - def has_test? - @text.include? "test do" - end end class FormulaAuditor @@ -109,9 +104,11 @@ class FormulaAuditor unless text.has_trailing_newline? problem "File should end with a newline" end + end + def audit_class if @strict - unless text.has_test? + unless formula.test_defined? problem "A `test do` test block should be added" end end @@ -595,6 +592,7 @@ class FormulaAuditor def audit audit_file + audit_class audit_specs audit_urls audit_deps |
