mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Additional methods to describe result
This commit is contained in:
parent
5819e0201e
commit
ac53394b8d
5 changed files with 42 additions and 3 deletions
|
@ -4,7 +4,7 @@ module Spectator
|
|||
class ErroredResult < FailedResult
|
||||
getter error : Exception
|
||||
|
||||
def errored? : Bool
|
||||
def errored?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,19 @@ module Spectator
|
|||
class FailedResult < Result
|
||||
getter error : Exception
|
||||
|
||||
def passed? : Bool
|
||||
def passed?
|
||||
false
|
||||
end
|
||||
|
||||
def failed?
|
||||
true
|
||||
end
|
||||
|
||||
def errored?
|
||||
false
|
||||
end
|
||||
|
||||
def pending?
|
||||
false
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,18 @@ module Spectator
|
|||
false
|
||||
end
|
||||
|
||||
def failed?
|
||||
false
|
||||
end
|
||||
|
||||
def errored?
|
||||
false
|
||||
end
|
||||
|
||||
def pending?
|
||||
true
|
||||
end
|
||||
|
||||
def initialize(@example)
|
||||
super(@example, Time::Span.new(nanoseconds: 0))
|
||||
end
|
||||
|
|
|
@ -4,6 +4,9 @@ module Spectator
|
|||
getter elapsed : Time::Span
|
||||
|
||||
abstract def passed? : Bool
|
||||
abstract def failed? : Bool
|
||||
abstract def errored? : Bool
|
||||
abstract def pending? : Bool
|
||||
|
||||
protected def initialize(@example, @elapsed)
|
||||
end
|
||||
|
|
|
@ -2,8 +2,20 @@ require "./result"
|
|||
|
||||
module Spectator
|
||||
class SuccessfulResult < Result
|
||||
def passed? : Bool
|
||||
def passed?
|
||||
true
|
||||
end
|
||||
|
||||
def failed?
|
||||
false
|
||||
end
|
||||
|
||||
def errored?
|
||||
false
|
||||
end
|
||||
|
||||
def pending?
|
||||
false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue