Merge pull request #3287 from DomT4/assert_predicate_audit
audit: tweak assert/refute_predicate audit
This commit is contained in:
		
						commit
						b568179222
					
				@ -967,12 +967,12 @@ class FormulaAuditor
 | 
				
			|||||||
      problem "Use `assert_match` instead of `assert ...include?`"
 | 
					      problem "Use `assert_match` instead of `assert ...include?`"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if line =~ /(assert File\.exist\?|File\.exist\?)/
 | 
					    if line =~ /(assert File\.exist\?|assert \(.*\)\.exist\?)/
 | 
				
			||||||
      problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
 | 
					      problem "Use `assert_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if line =~ /(assert !File\.exist\?|!File\.exist\?)/
 | 
					    if line =~ /assert !File\.exist\?/
 | 
				
			||||||
      problem "Use `refute_predicate <path_to_file>, :exist?` instead of `#{Regexp.last_match(1)}`"
 | 
					      problem "Use `refute_predicate <path_to_file>, :exist?` instead of `assert !File.exist?`"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return unless @strict
 | 
					    return unless @strict
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user