Skip to content

Commit

Permalink
Use green background for passing with skipped examples
Browse files Browse the repository at this point in the history
  • Loading branch information
icy-arctic-fox committed Aug 9, 2024
1 parent bd778bd commit 76b9485
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/spectator/formatters/common_text_output.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions src/spectator/formatters/summary.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 76b9485

Please sign in to comment.