From b43b09f46dc618d5fa6bd7e12cf560782bee2842 Mon Sep 17 00:00:00 2001 From: Michael Miller Date: Fri, 11 Jun 2021 18:31:41 -0600 Subject: [PATCH] Change order of pending result parameters --- src/spectator/example.cr | 4 ++-- src/spectator/harness.cr | 2 +- src/spectator/pending_result.cr | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/spectator/example.cr b/src/spectator/example.cr index e59c328..8cb921e 100644 --- a/src/spectator/example.cr +++ b/src/spectator/example.cr @@ -26,7 +26,7 @@ module Spectator # Result of the last time the example ran. # Is pending if the example hasn't run. - getter result : Result = PendingResult.new(Time::Span::ZERO, "Example not run") + getter result : Result = PendingResult.new("Example not run") # Creates the example. # An instance to run the test code in is given by *context*. @@ -89,7 +89,7 @@ module Spectator if pending? Log.debug { "Skipping example #{self} - marked pending" } @finished = true - return @result = PendingResult.new(Time::Span::ZERO, tags[:pending] || "No reason given") + return @result = PendingResult.new(tags[:pending] || "No reason given") end previous_example = @@current diff --git a/src/spectator/harness.cr b/src/spectator/harness.cr index 13ee409..0813758 100644 --- a/src/spectator/harness.cr +++ b/src/spectator/harness.cr @@ -121,7 +121,7 @@ module Spectator when ExpectationFailed FailResult.new(elapsed, error, @expectations) when ExamplePending - PendingResult.new(elapsed, error.message || "No reason given", @expectations) + PendingResult.new(error.message || "No reason given", elapsed, @expectations) else ErrorResult.new(elapsed, error, @expectations) end diff --git a/src/spectator/pending_result.cr b/src/spectator/pending_result.cr index 5cd61ef..83fc689 100644 --- a/src/spectator/pending_result.cr +++ b/src/spectator/pending_result.cr @@ -11,7 +11,7 @@ module Spectator # Creates the result. # *elapsed* is the length of time it took to run the example. # A *reason* for the skip/pending result can be specified. - def initialize(elapsed = Time::Span::ZERO, @reason = "No reason given", expectations = [] of Expectation) + def initialize(@reason = "No reason given", elapsed = Time::Span::ZERO, expectations = [] of Expectation) super(elapsed, expectations) end