Fix bug when running tests and there are no errors

This commit is contained in:
ViViDboarder 2013-06-03 16:24:04 -07:00
parent ca9b5dcd2a
commit 3f5c5c095b

View File

@ -130,19 +130,23 @@ module AbuseTheForce
# Need messages in an array # Need messages in an array
if result.run_test_result != nil if result.run_test_result != nil
unless result.run_test_result.failures.kind_of? Array
result.run_test_result.failures = [].push result.run_test_result.failures
end
puts "TESTS RUN: #{result.run_test_result.num_tests_run} FAILURES: #{result.run_test_result.num_failures}" puts "TESTS RUN: #{result.run_test_result.num_tests_run} FAILURES: #{result.run_test_result.num_failures}"
result.run_test_result.failures.each do |m| if result.run_test_result.failures != nil
# Print our error in teh format "filename:line:column type in object message" unless result.run_test_result.failures.kind_of? Array
if !m.success result.run_test_result.failures = [].push result.run_test_result.failures
puts "#{m.name}.#{m.method_name}: #{m.message}" end
puts "Stack Trace: #{m.stack_trace}"
puts "" result.run_test_result.failures.each do |m|
# Print our error in teh format "filename:line:column type in object message"
if !m.success
puts "#{m.name}.#{m.method_name}: #{m.message}"
puts "Stack Trace: #{m.stack_trace}"
puts ""
end
end end
end end
end end