class Spectator::FailedResult

Overview

Outcome that indicates running an example was a failure.

Direct Known Subclasses

Defined in:

spectator/failed_result.cr

Constructors

Instance Method Summary

Instance methods inherited from class Spectator::FinishedResult

elapsed : Time::Span elapsed, expectations : Expectations::ExampleExpectations expectations

Constructor methods inherited from class Spectator::FinishedResult

new(example, elapsed : Time::Span, expectations : Spectator::Expectations::ExampleExpectations) new

Instance methods inherited from class Spectator::Result

call(interface)
call(interface, &block : Result -> _)
call
, example : Example example, to_json(json : JSON::Builder) to_json

Constructor methods inherited from class Spectator::Result

new(example : Spectator::Example) new

Instance methods inherited from class Object

should(matcher) should, should_eventually(matcher) should_eventually, should_never(matcher) should_never, should_not(matcher) should_not

Constructor Detail

def self.new(example, elapsed, expectations, error : Exception) #

Creates a failed result. The example should refer to the example that was run and that this result is for. The elapsed argument is the length of time it took to run the example. The expectations references the expectations that were checked in the example. The error is the exception that was raised to cause the failure.


[View source]

Instance Method Detail

def call(interface) #

Calls the failure method on interface.


[View source]
def call(interface, &) #

Calls the failure method on interface and passes the yielded value.


[View source]
def error : Exception #

Error that occurred while running the example.


[View source]
def to_s(io) #

One-word descriptor of the result.


[View source]