Organizational Research By

Surprising Reserch Topic

can ocmock run a block parameter using -'ios,unit-testing,ocmock'

can ocmock run a block parameter  using -'ios,unit-testing,ocmock'

Assume a method signature such as the following:

- (void)theMethod:(void(^)(BOOL completed))completionBlock;

I would like to mock this method signature to ensure the method is called, and just call the completion block.  I see from other posts like this one that I can mock the method call and accept any block, but not run the block.  I also know there is a andDo method that I might be able to use, but I can't figure out how to pass a block in and run it.  

Any ideas?


asked Sep 7, 2015 by rajesh
0 votes

Related Hot Questions

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.