From 36f9f2b4343c9fdfa98bd4ffe9a05d1dda5c7c61 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Sun, 16 May 2021 20:23:16 -0600 Subject: [PATCH] Return true from run method if successful --- src/spectator/spec.cr | 4 +++- src/spectator/spec/runner.cr | 4 +--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectator/spec.cr b/src/spectator/spec.cr index a1e80ab..e85d5dc 100644 --- a/src/spectator/spec.cr +++ b/src/spectator/spec.cr @@ -13,7 +13,9 @@ module Spectator end # Runs all selected examples and returns the results. - def run + # True will be returned if the spec ran successfully, + # or false if there was at least one failure. + def run : Bool runner = Runner.new(examples, @config.formatter, @config.run_flags) runner.run end diff --git a/src/spectator/spec/runner.cr b/src/spectator/spec/runner.cr index 181361d..d5696ea 100644 --- a/src/spectator/spec/runner.cr +++ b/src/spectator/spec/runner.cr @@ -34,9 +34,7 @@ module Spectator profile = Profile.generate(@examples) if @run_flags.profile? && report.counts.run > 0 summarize(report, profile) - false # TODO: Report real result - - + report.counts.fail.zero? ensure close end