diff --git a/spec/wpscan_spec.rb b/spec/wpscan_spec.rb index 9c34f5a6..fcf8b997 100644 --- a/spec/wpscan_spec.rb +++ b/spec/wpscan_spec.rb @@ -27,10 +27,12 @@ describe 'wpscan main checks' do end it 'should check for valid syntax' do + result = "" Dir.glob("**/*.rb") do |file| res = %x{ruby -c #{ROOT_DIR}/#{file} 2>&1}.split("\n") ok = res.select {|msg| msg =~ /Syntax OK/} - fail("Syntax error in #{file}:\n" + res.join("\n")) if ok.size != 1 + result << ("####################\nSyntax error in #{file}:\n#{res.join("\n").strip()}\n") if ok.size != 1 end + fail(result) unless result.empty? end end