验证从未使用OCMock 3调用方法

Ev.*_*Ev. 9 cocoa objective-c ocmock

如何验证从未使用OCMock 3调用方法?

我在想这样的事情:

XCTAssertThrows(OCMVerify([_restDataSource getSomeStuff:[OCMArg any]]));
Run Code Online (Sandbox Code Playgroud)

但似乎OCMVerify不会失败.

Eri*_*urg 10

请参阅http://ocmock.org/reference/#advanced-topics下的第一点

请注意,reject此时需要旧式语法,并且必须在调用方法之前调用它,即.

// first set up the mock
[[mock reject] methodThatShouldNotBeCalled]
// then call method that should not result in the call
Run Code Online (Sandbox Code Playgroud)

有关计划内容的一瞥,请参阅https://github.com/erikdoe/ocmock/issues/109