I'm trying to check that a method is being called on an object, but I don't care about the arguments. One of the arguments is a value (a SEL). Here's an example that shows the problem I'm getting:
- Code: Select all
[[mockActionConfirmer expect] confirmActionWithCallback:OCMOCK_ANY onObject:OCMOCK_ANY];
[mockActionConfirmer confirmActionWithCallback:@selector(dummySelector) onObject:nil];
[mockActionConfirmer verify];
This fails with :
- Code: Select all
2011-02-02 12:15:24.879Unit Tests[53791:903] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'OCMockObject[ActionConfirmer]: unexpected method invoked: confirmActionWithCallback:@selector(dummySelector) onObject:nil
expected: confirmActionWithCallback:@selector((null)) onObject:<OCMAnyConstraint: 0x5e3c270>'
I'm assuming this doesn't work because I'm trying to use OCMOCK_ANY to set an expectation for a value type (SEL). Is there a way for me to set such an expectation?
Cheers,
Pete
