Skip to content

Conversation

JARinteractive
Copy link

This allows OCMArg to capture objects or blocks passed to a stubbed method

@zacwest
Copy link

zacwest commented Feb 13, 2014

Thank you, this is an amazing addition that really helps make writing tests easier. This should be part of the regular distribution.

@carllindberg
Copy link
Contributor

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants