I'm trying to write an XCTest (iOS7, XCode5) together with OCMock.
I've got a class which implements the CLLocationManagerDelegate protocol, and has a property which is an instance of a CLLocationManager. (I supply the instance of the CLLocationManager to the my initialiser method, so that I can inject it at runtime or test).
When testing the delegate class, I create a mock CLLocationManager.
In a test, I want to achieve something like this:
[[[[mockLocationManager stub] classMethod] andReturnValue:kCLAuthorizationStatusDenied] authorizationStatus];
result = [delegateUnderTest doMethod];
//Do asserts on result etc etc
The problem is, XCode is complaining about my code.
test.m:79:68: Implicit conversion of 'int' to 'NSValue *' is disallowed with ARC
test.m:79:68: Incompatible integer to pointer conversion sending 'int' to parameter of type 'NSValue *'
kCLAuthorizationStatusDenied is an int I understand (as defined in a TypeDef). So, I can't use
[[[[mockLocationManager stub] classMethod] andReturn:kCLAuthorizationStatusDenied] authorizationStatus];
which would expect an object ('andReturn' is an 'id').
Any ideas?