Assume a method signature such as the following:
- (void)theMethod:(void(^)(BOOL completed))completionBlock;
I would like to mock this meth
This is Sven's answer updated for OCMock 3.
OCMStub([myMock myMethodWithMyBlock:[OCMArg any]]).andDo(^(NSInvocation *invocation) { void (^passedBlock)(BOOL myFirstArgument, NSError *mySecondArgument); [invocation getArgument: &passedBlock atIndex: 2]; passedBlock(YES, nil); });