From 24b0639e27b69335ce10a1adb745e7025b3195c9 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 12 Jul 2015 18:08:14 +0100 Subject: [PATCH] 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 --- Library/Homebrew/cmd/audit.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index 708d6a3bcb..b161213060 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