Cast failure and error results

This commit is contained in:
Michael Miller 2019-02-12 23:34:56 -07:00
parent 8c5760e8dd
commit d0a8a1deae
2 changed files with 3 additions and 3 deletions

View file

@ -30,7 +30,7 @@ module Spectator::Formatters
puts "Failures:"
puts
failures.each_with_index do |failure, index|
display_failure(failure.as(FailedResult), index + 1)
display_failure(failure, index + 1)
end
end
end

View file

@ -28,7 +28,7 @@ module Spectator
# Returns a set of results for all failed examples.
def failures
@results.select(&.failed?)
@results.select(&.failed?).map(&.as(FailedResult))
end
# Number of examples that had errors.
@ -38,7 +38,7 @@ module Spectator
# Returns a set of results for all errored examples.
def errors
@results.select(&.errored?)
@results.select(&.errored?).map(&.as(ErroredResult))
end
# Number of pending examples.