is there any way to invoke a block with nil
as a given argument, given that the invokeBlockWithArgs:
requires the args to be nil-terminated?
example method definition in a mocked object:
- (void)methodWithCompletion:(void(^)(NSString*, NSError* )) completionBlock;
The given mockObject should call:
completionBlock(@"foo", nil);
however, with invokeBlockWithArgs
:
OCMStub([mockObj methodWithCompletion:([OCMArg invokeBlockWithArgs:@"foo", nil, nil])]);
Method fails, with too few arguments; obviously with nil being the termination, it doesn't recognize the second parameter to the block should be nil
.