Consolidate on one check and fix false positives

bug/bundler_fix
William Vu 2015-04-16 18:00:08 -05:00
parent 40f6b086c2
commit 832487cad7
1 changed files with 1 additions and 3 deletions

View File

@ -546,9 +546,7 @@ class Msftidy
end end
if ln =~ /^\s*fail_with\(/ if ln =~ /^\s*fail_with\(/
if ln =~ /^\s*fail_with\(['"].+['"]\)/ unless ln =~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),/
error("fail_with requires a Failure:: reason as first parameter: #{ln}", idx)
elsif ln !~ /^\s*fail_with\(Failure\:\:(?:None|Unknown|Unreachable|BadConfig|Disconnected|NotFound|UnexpectedReply|TimeoutExpired|UserInterrupt|NoAccess|NoTarget|NotVulnerable|PayloadFailed),.+\)/
error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx) error("fail_with requires a valid Failure:: reason as first parameter: #{ln}", idx)
end end
end end