Hey all, I'm trying to write a test for a method where the output depends on an NSDate's timeIntervalSinceNow return value. I'd like to specify the return value in my tests so I can test certain scenarios.
I'm having a really hard time getting this OCMock object returning what I'd like. Here's my code:
id mock = [OCMockObject mockForClass:[NSDate class]];
NSTimeInterval t = 20.0;
[[[mock stub] andReturnValue:OCMOCK_VALUE(t)] timeIntervalSinceNow];
STAssertEquals([mock timeIntervalSinceNow], 20.0, @"Should be eql.");
This generates a "error: expected specifier-qualifier-list before 'typeof" error.
Any thoughts? I'm new to ObjC, so any other related tips are greatly appreciated.
Thanks.