aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/audit.rb
diff options
context:
space:
mode:
authorMike McQuaid2015-07-12 18:08:14 +0100
committerMike McQuaid2015-07-14 11:54:38 -0700
commit24b0639e27b69335ce10a1adb745e7025b3195c9 (patch)
tree41a73cb4a0e56a9a19555b85c739ada850054cbd /Library/Homebrew/cmd/audit.rb
parentb554c8bcca3042f7e3664f7a892c285201cfbd39 (diff)
downloadbrew-24b0639e27b69335ce10a1adb745e7025b3195c9.tar.bz2
audit: recommend use of assert_match.
It produces significantly easier output to debug than doing `assert` and `.include?` (which just shows if it passed or failed). Closes Homebrew/homebrew#41662. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd/audit.rb')
-rw-r--r--Library/Homebrew/cmd/audit.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 708d6a3bc..b16121306 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -794,6 +794,10 @@ class FormulaAuditor
problem "Use the `#{method}` Ruby method instead of `system #{system}`"
end
+ if line =~ /assert .*\.include?/
+ problem "Use `assert_match` instead of `assert ...include?`"
+ end
+
if @strict
if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/
bad_system = $1