From d0a8a1deae7f792f93988267fdb9aba9845182e1 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Tue, 12 Feb 2019 23:34:56 -0700 Subject: [PATCH] Cast failure and error results --- src/spectator/formatters/default_formatter.cr | 2 +- src/spectator/report.cr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/spectator/formatters/default_formatter.cr b/src/spectator/formatters/default_formatter.cr index 34afb1b..df3b5f4 100644 --- a/src/spectator/formatters/default_formatter.cr +++ b/src/spectator/formatters/default_formatter.cr @@ -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 diff --git a/src/spectator/report.cr b/src/spectator/report.cr index 8438a8d..47b45ab 100644 --- a/src/spectator/report.cr +++ b/src/spectator/report.cr @@ -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.