2

Instead of the prefix test, I want to use spec because I prefer BDD vocabulary.

E.g., instead of:

- (void)testExample

I want to call it:

- (void)specExample

How can I do this?

ma11hew28
  • 121,420
  • 116
  • 450
  • 651

1 Answers1

1

After reading the source code of SenTestingKit, I added the following file to the test target:"

// NSInvocation+SetTestMethodPrefix.m

@implementation NSInvocation (SetTestMethodPrefix)

+ (void)load {
    [self performSelector:@selector(setTestMethodPrefix:) withObject:@"spec"];
}

@end

This works, but seems like a hack, especially since +[NSInvocation setTestMethodPrefix:] is private.

Is there a better way to do this?

ma11hew28
  • 121,420
  • 116
  • 450
  • 651