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(example : Spectator::Example)

Constructs the base of the result. The example should refer to the example that was run and that this result is for.

Source

Instance methods

call(interface)

Calls the corresponding method for the type of result. This is used to avoid placing if or case-statements everywhere based on type. Each sub-class implements this method by calling the correct method on interface.

Source
call(interface, &block : Result -> _)

Calls the corresponding method for the type of result. This is used to avoid placing if or case-statements everywhere based on type. Each sub-class implements this method by calling the correct method on interface. This variation takes a block, which is passed the result. The value returned from the block will be returned by this method.

Source
example

Example that was run that this result is for.

Source
to_json(json : JSON::Builder)

Creates a JSON object from the result information.

Source