struct

Spectator::Matchers::ReceiveMatcher

Inherits Spectator::Matchers::Matcher / Struct / Value / Object

Matcher that inspects stubbable objects for method calls.

Constructors

new(stub : Stub, count : Count = Count.new(1, nil))

Creates the matcher for expecting a method call matching a stub.

Source
new(expected : Expression(Symbol))

Creates the matcher for expecting a method call with any arguments. expected is an expression evaluating to the method name as a symbol.

Source

Instance methods

at_least(count : Int) : self

Returns a new matcher that checks that the stub was invoked at least a set amount of times.

Source
at_least_once

Returns a new matcher that checks that the stub was invoked at least once.

Source
at_least_twice

Returns a new matcher that checks that the stub was invoked at least twice.

Source
at_most(count : Int) : self

Returns a new matcher that checks that the stub was invoked at most a set amount of times.

Source
at_most_once

Returns a new matcher that checks that the stub was invoked at most once.

Source
at_most_twice

Returns a new matcher that checks that the stub was invoked at most twice.

Source
description

Short text about the matcher's purpose.

Source
exactly(count : Int) : self

Returns a new matcher that checks that the stub was invoked an exact number of times.

Source
match(actual : Expression(Stubbable) | Expression(StubbedType)) : MatchData

Actually performs the test against the expression (value or block).

Source
match(actual : Expression(T)) : MatchData forall T

Actually performs the test against the expression (value or block).

Source
negated_match(actual : Expression(Stubbable) | Expression(StubbedType)) : MatchData

Performs the test against the expression (value or block), but inverted.

Source
negated_match(actual : Expression(T)) : MatchData forall T

Performs the test against the expression (value or block), but inverted.

Source
once

Returns a new matcher that checks that the stub was invoked once.

Source
times

Returns self - used for fluent interface.

expect(dbl).to have_received(:foo).exactly(5).times
Source
twice

Returns a new matcher that checks that the stub was invoked twice.

Source
with(*args, **kwargs) : self

Returns a new matcher with an argument constraint.

Source

Nested types