class Spectator::Expectations::ExampleExpectations
Overview
Collection of expectations from an example.
Included Modules
- Enumerable(Spectator::Expectations::Expectation)
Defined in:
spectator/expectations/example_expectations.crConstructors
-
.new(expectations : Array(Expectation))
Creates the collection.
Instance Method Summary
-
#each(&)
Iterates through all expectations.
-
#each_satisfied(&)
Iterates over only the satisfied expectations.
-
#each_unsatisfied(&)
Iterates over only the unsatisfied expectations.
-
#failed?
Determines whether the example failed based on if any expectations were not satisfied.
-
#satisfied : Enumerable(Expectation)
Returns a collection of only the satisfied expectations.
-
#successful?
Determines whether the example was successful based on if all expectations were satisfied.
-
#to_json(json : JSON::Builder)
Creates the JSON representation of the expectations.
-
#unsatisfied : Enumerable(Expectation)
Returns a collection of only the unsatisfied expectations.
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
Instance Method Detail
Determines whether the example failed based on if any expectations were not satisfied.
Determines whether the example was successful based on if all expectations were satisfied.
Returns a collection of only the unsatisfied expectations.