Our captor recorded its use as a by product of successfully using
(actually: asking) matches. This leads to wrong behavior as soon
as the captor matches but the call signature as a whole still fails.
For example consider when(foo).bar(captor(), 11). Here the "any"
captor always matches even when the second argument, the literal "11",
fails.
Make the side-effect explicit by implementing a new capture_arguments
which is called if the whole call signature matches.
Fixes #49
Our
captor
recorded its use as a by product of successfully using (actually: asking)matches
. This leads to wrong behavior as soon as the captor matches but the call signature as a whole still fails.For example consider
when(foo).bar(captor(), 11)
. Here the "any" captor always matches even when the second argument, the literal "11", fails.Make the side-effect explicit by implementing a new
capture_arguments
which is called if the whole call signature matches.