class Spectator::Mocks::ReceiveExpectation(T)

Overview

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

Included Modules

Defined in:

spectator/mocks/receive_expectation.cr

Constructors

Instance Method Summary

Instance methods inherited from module Spectator::Mocks::ReceiveExpectationModifiers

with(*args, **kwargs) with

Instance methods inherited from module Spectator::Mocks::ReceiveCountExpectationModifiers

at_least(count : ReceiveCountKeyword)
at_least(n : Int)
at_least
, at_most(count : ReceiveCountKeyword)
at_most(n : Int)
at_most
, exactly(n : Int)
exactly(count : ReceiveCountKeyword)
exactly
, once once, twice twice

Constructor Detail

def self.new(method_name : Symbol) #

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


[View source]
def self.new(stub : T) #

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


[View source]

Instance Method Detail

def failure_message(actual_value) #

Error message displayed when the expectation fails.


[View source]
def match(actual_value : Stubbable) #

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


[View source]
def match(actual_value) #

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


[View source]
def negative_failure_message(actual_value) #

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


[View source]