abstract class Spectator::Result


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:



Instance Method Summary

Instance methods inherited from class Object

should(matcher, message = nil) should, should_eventually(matcher, message = nil) should_eventually, should_never(matcher, message = nil) should_never, should_not(matcher, message = nil) should_not

Constructor Detail

def self.new(elapsed, expectations = [] 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]