class

Mocks::ReceiveExpectation(T)

Inherits Mocks::ReceiveExpectationModifiers < Mocks::ReceiveCountExpectationModifiers < Reference < Object

Expectation that checks if a stubbable object received a method call.

Constructors

new(method_name : Symbol)

Creates an expectation that will match all calls with a specific method name.

Source
new(stub : T)

Creates an expectation with a stub. A stub is used to pattern match calls made to an object.

Source

Instance methods

failure_message(actual_value)

Error message displayed when the expectation fails.

Source
match(actual_value : Stubbable)

Checks if a stubbable object received a call defined by this expectation.

Source
match(actual_value)

Fallback method that produces a compiler error message when attempting to check a non-stubbable object.

Source
negative_failure_message(actual_value)

Error message displayed when the expectation fails in the negated case.

Source