mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Colorize result string based on outcome
This commit is contained in:
parent
8e1a2e114b
commit
625262b6d5
1 changed files with 8 additions and 1 deletions
|
@ -39,7 +39,14 @@ module Spectator
|
||||||
failures = results.failed_examples
|
failures = results.failed_examples
|
||||||
errors = results.errored_examples
|
errors = results.errored_examples
|
||||||
pending = results.pending_examples
|
pending = results.pending_examples
|
||||||
"#{examples} examples, #{failures} failures, #{errors} errors, #{pending} pending"
|
string = "#{examples} examples, #{failures} failures, #{errors} errors, #{pending} pending"
|
||||||
|
if failures > 0 || errors > 0
|
||||||
|
string.colorize.red
|
||||||
|
elsif pending != examples
|
||||||
|
string.colorize.yellow
|
||||||
|
else
|
||||||
|
string.colorize.green
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private def human_time(span : Time::Span)
|
private def human_time(span : Time::Span)
|
||||||
|
|
Loading…
Reference in a new issue