I'm trying to mock a class method, and it doesn't seem to be working as expected. any thoughts?
@implementation ApplicationVersionManager
+ (NSString *)appVersion {
return [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
}
@end
Test
- (void)testSomething {
OCMStub([ApplicationVersionManager appVersion]).andReturn(@"3.0");
NSString *version = [ApplicationVersionManager appVersion];
// version is nil. Why?
}