diff --git a/src/spectator/formatters/common_text_output.cr b/src/spectator/formatters/common_text_output.cr index c07d2808..d6cb0e81 100644 --- a/src/spectator/formatters/common_text_output.cr +++ b/src/spectator/formatters/common_text_output.cr @@ -133,7 +133,7 @@ module Spectator::Formatters when .skipped? then "Passed (with skipped examples)" else "Finished" end - printer.print_title(summary.style, &.<< status) + printer.print_title(summary.title_style, &.<< status) printer.puts printer << "Finished after " << humanize(summary.total_time) diff --git a/src/spectator/formatters/summary.cr b/src/spectator/formatters/summary.cr index 75defb49..7c27155b 100644 --- a/src/spectator/formatters/summary.cr +++ b/src/spectator/formatters/summary.cr @@ -46,6 +46,15 @@ module Spectator::Formatters end end + def title_style : Style + case self + when .passed? then Style::Success + when .failed? then Style::Error + when .skipped? then Style::Success + else Style::Info + end + end + def overhead_time : Time::Span total_time - test_time end