struct Spectator::Expectations::ExpectationPartial(T)

Overview

Stores part of an expectation (obviously). The part of the expectation this type covers is the actual value and source. This can also cover a block's behavior.

Defined in:

spectator/expectations/expectation_partial.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(actual : TestExpression(T), source : Source) #

Creates the partial.


[View source]

Instance Method Detail

def actual : TestExpression(T) #

The actual value being tested. This also contains its label.


[View source]
def never_to(matcher) : Nil #

[View source]
def not_to(matcher) : Nil #

[View source]
def source : Source #

Location where this expectation was defined.


[View source]
def to(stubs : Enumerable(Mocks::MethodStub)) : Nil #

[View source]
def to(stub : Mocks::MethodStub) : Nil #

[View source]
def to(matcher) : Nil #

Asserts that some criteria defined by the matcher is satisfied.


[View source]
def to_eventually(stubs : Enumerable(Mocks::MethodStub)) : Nil #

[View source]
def to_eventually(stub : Mocks::MethodStub) : Nil #

[View source]
def to_eventually(matcher) : Nil #

Asserts that some criteria defined by the matcher is eventually satisfied. The expectation is checked after the example finishes and all hooks have run.


[View source]
def to_never(stub : Enumerable(Mocks::MethodStub)) : Nil #

[View source]
def to_never(stub : Mocks::MethodStub) : Nil #

[View source]
def to_never(matcher) : Nil #

Asserts that some criteria defined by the matcher is never satisfied. The expectation is checked after the example finishes and all hooks have run.


[View source]
def to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil #

[View source]
def to_not(stub : Mocks::MethodStub) : Nil #

[View source]
def to_not(matcher) : Nil #

Asserts that some criteria defined by the matcher is not satisfied. This is effectively the opposite of #to.


[View source]