Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCMock Argument capture support #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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