Skip to content

Instantly share code, notes, and snippets.

@HHuckebein
Created August 27, 2013 06:55
Show Gist options
  • Save HHuckebein/6350411 to your computer and use it in GitHub Desktop.
Save HHuckebein/6350411 to your computer and use it in GitHub Desktop.
Testing the infoBarButtonItem objects segue connection. Here it should be named after the string "InfoVCSegue"
- (void)test_infoBarButtonItemSegue
{
// then
UIBarButtonItem *button = [self.sut infoBarButtonItem];
SEL selector = [button action];
assertThat(NSStringFromSelector(selector), is(equalTo(@"perform:")));
id target = [button target];
assertThat(NSStringFromClass([[target class] superclass]), is(equalTo(@"UIStoryboardSegueTemplate")));
if ([NSStringFromClass([[target class] superclass]) isEqualToString:@"UIStoryboardSegueTemplate"]) {
assertThat([target identifier], is(equalTo(@"InfoVCSegue")));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment