13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/test_notifier/runner/test_unit.rb', line 13
def finished(elapsed_time)
finished_original(elapsed_time)
begin
re = /(\d+) tests, (\d+) assertions, (\d+) failures, (\d+) errors/
_, tests, assertions, failures, errors = *@result.to_s.match(re)
return if tests.to_i.zero?
stats = TestNotifier::Stats.new(:test_unit, {
count: tests,
assertions: assertions,
failures: failures,
errors: errors
})
TestNotifier.notify(status: stats.status, message: stats.message)
rescue StandardError => error
puts error
puts error.backtrace
end
end
|