2
而不是前缀test
,我想使用spec
,因为我更喜欢BDD词汇。OCUnit:如何更改测试用例方法的前缀?
,而不是如:
- (void)testExample
我想称之为:
- (void)specExample
我怎样才能做到这一点?
而不是前缀test
,我想使用spec
,因为我更喜欢BDD词汇。OCUnit:如何更改测试用例方法的前缀?
,而不是如:
- (void)testExample
我想称之为:
- (void)specExample
我怎样才能做到这一点?
阅读source code of SenTestingKit后,我增加了以下文件,以测试目标:”
// NSInvocation+SetTestMethodPrefix.m
@implementation NSInvocation (SetTestMethodPrefix)
+ (void)load {
[self performSelector:@selector(setTestMethodPrefix:) withObject:@"spec"];
}
@end
这工作,但似乎是一个黑客,特别是因为+[NSInvocation setTestMethodPrefix:]
是私人
有没有更好的。怎么做?