module Spectator::Mocks::ReceiveCountExpectationModifiers

Direct including types

Defined in:

spectator/mocks/receive_count_expectation_modifiers.cr

Instance Method Summary

Instance Method Detail

def at_least(count : ReceiveCountKeyword) #

Modifies the expectation to check for at least a specified number of calls.

3.times { double.some_method }
double.should have_received(:some_method).at_least(:once)

[View source]
def at_least(n : Int) #

Modifies the expectation to check for at least a specified number of calls.

3.times { double.some_method }
double.should have_received(:some_method).at_least(1).time

[View source]
def at_most(count : ReceiveCountKeyword) #

Modifies the expectation to check for at most a specified number of calls.

2.times { double.some_method }
double.should have_received(:some_method).at_most(:twice)

[View source]
def at_most(n : Int) #

Modifies the expectation to check for at most a specified number of calls.

2.times { double.some_method }
double.should have_received(:some_method).at_most(3).times

[View source]
def exactly(n : Int) #

Modifies the expectation to check for an exact number of calls.

3.times { double.some_method }
double.should have_received(:some_method).exactly(3).times

[View source]
def exactly(count : ReceiveCountKeyword) #

Modifies the expectation to check for an exact number of calls.

double.some_method
double.should have_received(:some_method).exactly(:once)

[View source]
def once #

Modifies the expectation to check for exactly one matching call.

double.some_method
double.should have_received(:some_method).once

[View source]
def twice #

Modifies the expectation to check for exactly two matching calls.

double.some_method
double.some_method
double.should have_received(:some_method).twice

[View source]