I have been using OCMock recently for my unit testing. I need to objectForInfoDictionaryKey: from NSBundle . I have done the following:
self.bundleMock = OCMClassMock([NSBundle class]); OCMStub([self.bundleMock objectForInfoDictionaryKey:@"GITHash"]).andReturn(@"c424242"); ;
Here is the call I want to drown out:
NSString * appHashString = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"GITHash"];
But nothing seems to have sharpened, at runtime I still have the “correct” meaning.
What have I done wrong?
source share