From 49f6c940e2cd091ef190224f2a1b8eac04f37f01 Mon Sep 17 00:00:00 2001 From: Christian Mehlmauer Date: Fri, 15 Feb 2013 10:17:47 +0100 Subject: [PATCH] output all syntax errors at once --- spec/wpscan_spec.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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