mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Initial formatting output for failures
This commit is contained in:
parent
dcbca302dc
commit
5e4f0f3bbc
2 changed files with 39 additions and 0 deletions
src/spectator
|
@ -20,6 +20,37 @@ module Spectator
|
|||
def end_suite(results : TestResults)
|
||||
puts
|
||||
puts
|
||||
display_failures(results)
|
||||
display_errors(results)
|
||||
display_summary(results)
|
||||
end
|
||||
|
||||
private def display_failures(results)
|
||||
failures = results.failures
|
||||
if failures.any?
|
||||
puts "Failures:"
|
||||
puts
|
||||
failures.each_with_index do |failure, index|
|
||||
display_failure(failure, index + 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private def display_failure(failure, number)
|
||||
expected = "TODO"
|
||||
actual = "TODO"
|
||||
puts " #{number}) #{failure.example}"
|
||||
puts " Failure: <INSERT EXPECTATION HERE>"
|
||||
puts
|
||||
puts " Expected: #{expected}"
|
||||
puts " got: #{actual}"
|
||||
puts
|
||||
end
|
||||
|
||||
private def display_errors(results)
|
||||
end
|
||||
|
||||
private def display_summary(results)
|
||||
puts finish_time_string(results)
|
||||
puts result_string(results)
|
||||
end
|
||||
|
|
|
@ -20,10 +20,18 @@ module Spectator
|
|||
@results.count(&.failed?)
|
||||
end
|
||||
|
||||
def failures
|
||||
@results.select(&.failed?)
|
||||
end
|
||||
|
||||
def errored_examples
|
||||
@results.count(&.errored?)
|
||||
end
|
||||
|
||||
def errors
|
||||
@results.select(&.errored?)
|
||||
end
|
||||
|
||||
def pending_examples
|
||||
@results.count(&.pending?)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue