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.
Sourcenew(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.
SourceInstance methods
at_least(count : Int) : self
Returns a new matcher that checks that the stub was invoked at least a set amount of times.
Sourceat_least_once
Returns a new matcher that checks that the stub was invoked at least once.
Sourceat_least_twice
Returns a new matcher that checks that the stub was invoked at least twice.
Sourceat_most(count : Int) : self
Returns a new matcher that checks that the stub was invoked at most a set amount of times.
Sourceat_most_once
Returns a new matcher that checks that the stub was invoked at most once.
Sourceat_most_twice
Returns a new matcher that checks that the stub was invoked at most twice.
Sourcedescription
Short text about the matcher's purpose.
Sourceexactly(count : Int) : self
Returns a new matcher that checks that the stub was invoked an exact number of times.
Sourcematch(actual : Expression(Stubbable) | Expression(StubbedType)) : MatchData
Actually performs the test against the expression (value or block).
Sourcematch(actual : Expression(T)) : MatchData forall T
Actually performs the test against the expression (value or block).
Sourcenegated_match(actual : Expression(Stubbable) | Expression(StubbedType)) : MatchData
Performs the test against the expression (value or block), but inverted.
Sourcenegated_match(actual : Expression(T)) : MatchData forall T
Performs the test against the expression (value or block), but inverted.
Sourceonce
Returns a new matcher that checks that the stub was invoked once.
Sourcetimes
Returns self - used for fluent interface.
expect(dbl).to have_received(:foo).exactly(5).times
Sourcetwice
Returns a new matcher that checks that the stub was invoked twice.
Sourcewith(*args, **kwargs) : self
Returns a new matcher with an argument constraint.
Source