I have a method with the following signature that I want to test using OCMock's stub feature:
- (void)signInWithEmail:(NSString *)email andWithPassword:(NSString *)password andWithBlock:(void (^)(GNCustomer *customer, NSError *error))block
How would I go about mocking this to handle the returned block.
I have tried:
[[_mockAuthenticationRepository stub] signInWithEmail:[OCMArg any] andWithPassword:[OCMArg any] andWithBlock:^(GNCustomer *customer, NSError *error) {
}];
When I try to stub with this approach, I received unexpected method invoked which indicates that my stub is not being used.
Thanks!
Well I figured this out :) Here's the answer: