allending/Kiwi — Issue #80: What's the best way to handle a timer?
Author: jessbowers
Created: 2011-12-20 01:51:29+00:00
State: open

How do we test timers?

I have a method that fires a timer

- (void)setItOff;
{
self.timer = [NSTimer timerWithTimeInterval:1.0 target:[self missle] selector:@selector(launch) userInfo:nil repeats:NO]
}

And I want to test it with a mock, similar to this:

id missleMock = [Missle mock];
[[missleMock should] receive:@selector(launch)];
[self setItOff];