Change order of pending result parameters

This commit is contained in:
Michael Miller 2021-06-11 18:31:41 -06:00
parent 3b1db7b772
commit b43b09f46d
No known key found for this signature in database
GPG key ID: FB9F12F7C646A4AD
3 changed files with 4 additions and 4 deletions

View file

@ -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

View file

@ -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

View file

@ -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