class Spectator::Expectations::ExampleExpectations

Overview

Collection of expectations from an example.

Included Modules

Defined in:

spectator/expectations/example_expectations.cr

Constructors

Instance Method Summary

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(expectations : Array(Expectation)) #

Creates the collection.


[View source]

Instance Method Detail

def each(&) #

Iterates through all expectations.


[View source]
def each_satisfied(&) #

Iterates over only the satisfied expectations.


[View source]
def each_unsatisfied(&) #

Iterates over only the unsatisfied expectations.


[View source]
def failed? #

Determines whether the example failed based on if any expectations were not satisfied.


[View source]
def satisfied : Enumerable(Expectation) #

Returns a collection of only the satisfied expectations.


[View source]
def successful? #

Determines whether the example was successful based on if all expectations were satisfied.


[View source]
def to_json(json : JSON::Builder) #

Creates the JSON representation of the expectations.


[View source]
def unsatisfied : Enumerable(Expectation) #

Returns a collection of only the unsatisfied expectations.


[View source]