class Spectator::PendingResult

Overview

Outcome that indicates running an example was pending. A pending result means the example is not ready to run yet. This can happen when the functionality to be tested is not implemented yet.

Defined in:

spectator/pending_result.cr

Constant Summary

DEFAULT_REASON = "No reason given"

Constructors

Instance Method Summary

Instance methods inherited from class Spectator::Result

accept(visitor) accept, elapsed : Time::Span elapsed, expectations : Enumerable(Expectation) expectations, fail? : Bool fail?, pass? : Bool pass?, pending? : Bool pending?, to_json(json : JSON::Builder) to_json

Constructor methods inherited from class Spectator::Result

new(elapsed : Time::Span, expectations : Enumerable(Spectator::Expectation) = [] of Expectation) new

Instance methods inherited from class Object

should(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should
, should_eventually(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_eventually, should_never(matcher, message = nil, *, _file = __FILE__, _line = __LINE__) should_never, should_not(matcher : Spectator::Matchers::TypeMatcher(U), message = nil, *, _file = __FILE__, _line = __LINE__) forall U
should_not(matcher : Spectator::Matchers::NilMatcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not(matcher, message = nil, *, _file = __FILE__, _line = __LINE__)
should_not

Constructor Detail

def self.new(reason : String = DEFAULT_REASON, location : Spectator::Location | Nil = nil, elapsed = Time::Span::ZERO, expectations = [] of Expectation) #

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. If the pending result was triggered inside of an example, then location can be set.


[View source]

Instance Method Detail

def accept(visitor) #

Calls the pending method on the visitor.


[View source]
def accept(visitor, &) #

Calls the pending method on the visitor.


[View source]
def fail? : Bool #

Indicates whether the example failed.


[View source]
def location : Location #

Location the pending result was triggered from.


[View source]
def location? : Location | Nil #

Location the pending result was triggered from.


[View source]
def pass? : Bool #

Indicates whether the example passed.


[View source]
def reason : String #

Reason the example was skipped or marked pending.


[View source]
def to_json(json : JSON::Builder) #

Creates a JSON object from the result information.


[View source]
def to_s(io : IO) : Nil #

One-word description of the result.


[View source]