I'm using since recently OCMock for my unit testing. I need to stub the
objectForInfoDictionaryKey:
method from NSBundle
. I've done the following :
self.bundleMock = OCMClassMock([NSBundle class]);
OCMStub([self.bundleMock objectForInfoDictionaryKey:@"GITHash"]).andReturn(@"c424242");
;
Here is the call I wanna stub :
NSString * appHashString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"GITHash"];
But nothing seem to be stubbed, at runtime I still have the "correct" value.
What did I do wrong ?