ocmock
ocmock copied to clipboard
OCMock Argument capture support
This allows OCMArg to capture objects or blocks passed to a stubbed method
Thank you, this is an amazing addition that really helps make writing tests easier. This should be part of the regular distribution.
Is this much different than something like:
__block id var;
[[mock expect] someMethodWithArg:[OCMArg checkWithBlock:BOOL^(id param){ var = param; return YES; }];
?
Also, not sure how the "void *" will work with ARC. NSInvocations are dangerous that way... you have to declare the local variables __unsafe_unretained when pulling values out. This might be a similar situation (though the checkWithBlock: approach does not have that issue).