abstract class Spectator::Result

Overview

Base class that represents the outcome of running an example. Sub-classes contain additional information specific to the type of result.

Direct Known Subclasses

Defined in:

spectator/result.cr

Constructors

Instance Method Summary

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(elapsed : Time::Span, expectations : Enumerable(Spectator::Expectation) = [] of Expectation) #

Creates the result. elapsed is the length of time it took to run the example.


[View source]

Instance Method Detail

abstract def accept(visitor) #

Calls the corresponding method for the type of result. This is the visitor design pattern.


[View source]
def elapsed : Time::Span #

Length of time it took to run the example.


[View source]
def expectations : Enumerable(Expectation) #

The assertions checked in the example.


[View source]
abstract def fail? : Bool #

Indicates whether the example failed.


[View source]
abstract def pass? : Bool #

Indicates whether the example passed.


[View source]
def pending? : Bool #

Indicates whether the example was skipped.


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

Creates a JSON object from the result information.


[View source]