I'm writing some tests, where I need to
- stub a call to a mock CLLocationManager to return a particular CLLocation
- and in turn that CLLocation needs to have a timestamp that is in the past
Creating instances of CLLocation is easy enough, but the timestamp property on it is read-only and fixed to the point in time when the instance was created. So, I planned to create a mock CLLocation, and stub the timestamp call too.
So, code looks like this:
[[CLLocationManager stubAndReturn:theValue(YES)] locationServicesEnabled];
NSDate *oldDate = [IPPOTestSupportMethods createNSDateSubtractingDays:2];
//TODO - Why is line below failing
[[expectedOldLocationMock stubAndReturn:oldDate] timestamp];
[[locationMgrMock stubAndReturn:expectedOldLocationMock] location];
In summary, I've got a CLLocationManager mock, I create an NSDate that is two days earlier than today. I want that date to be returned when I call
[cllocationmock timestamp];
However, I'm getting and ARC Semantic Issue.
IPPOLocationManagerDelegateImplKiwiTests.m:203:33: Multiple methods named 'timestamp' found with mismatched result, parameter type or attributes
Is this an issue in Kiwi, or am I missing something?