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
|
class ErroredResult < FailedResult
|
||||||
getter error : Exception
|
getter error : Exception
|
||||||
|
|
||||||
def errored? : Bool
|
def errored?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,7 +4,19 @@ module Spectator
|
||||||
class FailedResult < Result
|
class FailedResult < Result
|
||||||
getter error : Exception
|
getter error : Exception
|
||||||
|
|
||||||
def passed? : Bool
|
def passed?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def failed?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
|
def errored?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,18 @@ module Spectator
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def failed?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def errored?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
def initialize(@example)
|
def initialize(@example)
|
||||||
super(@example, Time::Span.new(nanoseconds: 0))
|
super(@example, Time::Span.new(nanoseconds: 0))
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,9 @@ module Spectator
|
||||||
getter elapsed : Time::Span
|
getter elapsed : Time::Span
|
||||||
|
|
||||||
abstract def passed? : Bool
|
abstract def passed? : Bool
|
||||||
|
abstract def failed? : Bool
|
||||||
|
abstract def errored? : Bool
|
||||||
|
abstract def pending? : Bool
|
||||||
|
|
||||||
protected def initialize(@example, @elapsed)
|
protected def initialize(@example, @elapsed)
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,8 +2,20 @@ require "./result"
|
||||||
|
|
||||||
module Spectator
|
module Spectator
|
||||||
class SuccessfulResult < Result
|
class SuccessfulResult < Result
|
||||||
def passed? : Bool
|
def passed?
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def failed?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def errored?
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
|
def pending?
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue