diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index ee5fb8df81..16ae7cba10 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -967,12 +967,12 @@ class FormulaAuditor problem "Use `assert_match` instead of `assert ...include?`" end - if line =~ /(assert File\.exist\?|File\.exist\?)/ + if line =~ /(assert File\.exist\?|assert \(.*\)\.exist\?)/ problem "Use `assert_predicate , :exist?` instead of `#{Regexp.last_match(1)}`" end - if line =~ /(assert !File\.exist\?|!File\.exist\?)/ - problem "Use `refute_predicate , :exist?` instead of `#{Regexp.last_match(1)}`" + if line =~ /assert !File\.exist\?/ + problem "Use `refute_predicate , :exist?` instead of `assert !File.exist?`" end return unless @strict