class

Spectator::Expectations::ExpectationReporter

Inherits Reference < Object

Tracks the expectations and their outcomes in an example. A single instance of this class should be associated with one example.

Constructors

new(raise_on_failure : Bool = true)

Creates the reporter. When the raise_on_failure flag is set to true, which is the default, an exception will be raised on the first failure that is reported. To store failures and continue, set the flag to false.

Source

Instance methods

expectations

Returns the reported expectations from the example. This should be run after the example has finished.

Source
report(expectation : Expectation) : Nil

Stores the outcome of an expectation. If the raise on failure flag is set to true, then this method will raise an exception when a failing result is given.

Source