lib/parallel_tests/cli.rb in parallel_tests-0.8.6 vs lib/parallel_tests/cli.rb in parallel_tests-0.8.7
- old
+ new
@@ -32,11 +32,11 @@
end
report_results runner, test_results
end
- abort "#{lib.capitalize}s Failed" if any_test_failed?(test_results)
+ abort final_fail_message(lib) if any_test_failed?(test_results)
end
def self.run_tests(runner, group, process_number, options)
if group.empty?
{:stdout => '', :exit_status => 0}
@@ -131,8 +131,18 @@
def self.report_time_taken
start = Time.now
yield
puts ""
puts "Took #{Time.now - start} seconds"
+ end
+
+ def self.final_fail_message(lib)
+ fail_message = "#{lib.capitalize}s Failed"
+ fail_message = "\e[31m#{fail_message}\e[0m" if use_colors?
+ fail_message
+ end
+
+ def self.use_colors?
+ $stdout.tty?
end
end
end