struct

Spectator::Expectations::ExpectationPartial(T)

Inherits Struct < Value < Object

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.

Constructors

new(actual : TestExpression(T), source : Source)

Creates the partial.

Source

Instance methods

actual

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

Source
never_to(matcher) : Nil
Source
not_to(matcher) : Nil
Source
source

Location where this expectation was defined.

Source
to(stubs : Enumerable(Mocks::MethodStub)) : Nil
Source
to(stub : Mocks::MethodStub) : Nil
Source
to(matcher) : Nil

Asserts that some criteria defined by the matcher is satisfied.

Source
to_eventually(stubs : Enumerable(Mocks::MethodStub)) : Nil
Source
to_eventually(stub : Mocks::MethodStub) : Nil
Source
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.

Source
to_never(stub : Enumerable(Mocks::MethodStub)) : Nil
Source
to_never(stub : Mocks::MethodStub) : Nil
Source
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.

Source
to_not(stubs : Enumerable(Mocks::MethodStub)) : Nil
Source
to_not(stub : Mocks::MethodStub) : Nil
Source
to_not(matcher) : Nil

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

Source