I am trying to check if a class method is getting invoked using OCMock. I have gathered from OCMock website and other answers on SO that the new OCMock release (2.1) adds suppor
Maybe I'm missing something here (and I know this is a bit old), but your class signature is +(BOOL)getBoolVal { return YES; }
and in your test, you're calling expect on getBoolVal:nil
Those don't match, right? In that case, your class mock will say, "Oh, that's not the signature I expect" and try to pass it on to the underyling class, I believe. See the forwardInvocationForClassObject
in the OCMock source.
As far as why you're getting NO (since the underlying class also returns YES, which makes this test kind of moot, but that's another issue), I'm not 100% sure, but maybe it's just a C-ism -- 'indeterminate value, void, 0 (false/NO)"