class

Spectator::Result

Inherits Reference / Object

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

Constructors

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.

Source

Instance methods

accept(visitor)

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

Source
elapsed

Length of time it took to run the example.

Source
expectations

The assertions checked in the example.

Source
fail?

Indicates whether the example failed.

Source
pass?

Indicates whether the example passed.

Source
pending?

Indicates whether the example was skipped.

Source
to_json(json : JSON::Builder)

Creates a JSON object from the result information.

Source