Can OCMock run a block parameter?

前端 未结 5 1879
予麋鹿
予麋鹿 2020-12-29 22:12

Assume a method signature such as the following:

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

I would like to mock this meth

5条回答
  •  不知归路
    2020-12-29 22:28

    This is now supported in OCMock 3.2. You can use [OCMArg invokeBlock] and [OCMArg invokeBlockWithArgs:...] to invoke the block passed as an argument to a stubbed method.

提交回复
热议问题