class

Spectator::FailResult

Inherits Spectator::Result / Reference / Object

Outcome that indicates an example failed. This typically means an assertion did not pass.

Constructors

new(elapsed, error : Exception, expectations = [] of Expectation)

Creates a failure result. The elapsed argument is the length of time it took to run the example. The error is the exception raised that caused the failure.

Source

Instance methods

accept(visitor)

Calls the failure method on visitor.

Source
accept(visitor, &)

Calls the failure method on visitor.

Source
error

Error that occurred while running the example. This describes the primary reason for the failure.

Source
fail?

Indicates whether the example failed.

Source
location

Attempts to retrieve the location where the example failed. This only works if the location of the failed expectation was reported. If available, returns a Location, otherwise raises NilAssertionError.

Source
location?

Attempts to retrieve the location where the example failed. This only works if the location of the failed expectation was reported. If available, returns a Location, otherwise nil.

Source
pass?

Indicates whether the example passed.

Source
to_json(json : JSON::Builder)

Creates a JSON object from the result information.

Source
to_s(io : IO) : Nil

One-word description of the result.

Source