88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File 'lib/lesli_testing/minitest/cli_reporter.rb', line 88
def report
super
total_tests = count.to_i
total_failures = failures.to_i
total_errors = errors.to_i
total_skips = skips.to_i
total_assertions = assertions.to_i
duration = total_time.to_f
passed = total_tests - total_failures - total_errors - total_skips
success_rate = total_tests.zero? ? 0 : ((passed.to_f / total_tests) * 100).round(1)
status = (total_failures.zero? && total_errors.zero?) ? "PASS" : "FAIL"
Termline.br 2
status_color = :blue
status_color = :red if status == 'FAIL'
failures_color = :blue
failures_color = :red if total_failures > 0
puts(Termline::Msg.builder(status, tag:'STATUS . . . . . . . :', color: status_color, timestamp:nil))
puts(Termline::Msg.builder(total_tests, tag:'TESTS. . . . . . . . :', color: :blue, timestamp:nil))
puts(Termline::Msg.builder(passed, tag:'PASSED . . . . . . . :', color: :blue, timestamp:nil))
puts(Termline::Msg.builder(total_failures, tag:'FAILURES . . . . . . :', color: failures_color, timestamp:nil))
puts(Termline::Msg.builder(total_errors, tag:'ERRORS . . . . . . . :', color: :blue, timestamp:nil))
puts(Termline::Msg.builder(total_skips, tag:'SKIPPED. . . . . . . :', color: :blue, timestamp:nil))
puts(Termline::Msg.builder(total_assertions, tag:'ASSERTIONS . . . . . :', color: :blue, timestamp:nil))
puts(Termline::Msg.builder("#{success_rate}%", tag:'SUCCESS RATE . . . . :', color: failures_color, timestamp:nil))
puts(Termline::Msg.builder(format("%.2fs", duration),tag:'TIME . . . . . . . . :', color: :blue, timestamp:nil))
Termline.br 2
if status == "PASS"
Termline.success("Test suite passed")
else
Termline.danger("Test suite failed", tag:'FAILURE')
end
Termline.br 2
print_failure_details if total_failures.positive? || total_errors.positive?
end
|