title: Best way to test storyboards with OCMockito
body: <p>I'm trying to test an application based on storyboards. The scenario is a Navigation Controller with a View Controller inside. The test is that performing a segue sets a view controller as destination controller (push segue). I'm using OCMockito and here's my test:</p>
  
  <pre><code>MyViewController *mockSut = mock([MyViewController class]);
  UINavigationController *nav = mock([UINavigationController class]);
  
  [given(mockSut.navigationController) willReturn:nav];
  [mockSut performSegueWithIdentifier:@"mySegue" sender:nil];
  
  MKTArgumentCaptor *segueArgument = [[MKTArgumentCaptor alloc] init];
  MKTArgumentCaptor *senderArgument = [[MKTArgumentCaptor alloc] init];
  
  [verify(mockSut) prepareForSegue:[segueArgument capture] sender:[senderArgument capture]];
  assertThat([[[segueArgument value] destinationViewController] class], equalTo([MyDestinationViewController class]));
  </code></pre>
  
  <p>But it complains that <code>prepareForSegue:</code> method was not invoked.</p>
  
  <p>What's the problem here? Maybe that <code>performSegueWithIdentifier:</code> invokes <code>prepareForSegue:</code> in an asynchronous way?</p>