QuickSpecBase.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #import "QuickSpecBase.h"
  2. #pragma mark - _QuickSpecBase
  3. @implementation _QuickSpecBase
  4. - (instancetype)init {
  5. self = [super initWithInvocation: nil];
  6. return self;
  7. }
  8. /**
  9. Invocations for each test method in the test case. QuickSpec overrides this method to define a
  10. new method for each example defined in +[QuickSpec spec].
  11. @return An array of invocations that execute the newly defined example methods.
  12. */
  13. + (NSArray<NSInvocation *> *)testInvocations {
  14. NSArray<NSString *> *selectors = [self _qck_testMethodSelectors];
  15. NSMutableArray<NSInvocation *> *invocations = [NSMutableArray arrayWithCapacity:selectors.count];
  16. for (NSString *selectorString in selectors) {
  17. SEL selector = NSSelectorFromString(selectorString);
  18. NSMethodSignature *signature = [self instanceMethodSignatureForSelector:selector];
  19. NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
  20. invocation.selector = selector;
  21. [invocations addObject:invocation];
  22. }
  23. return invocations;
  24. }
  25. + (NSArray<NSString *> *)_qck_testMethodSelectors {
  26. return @[];
  27. }
  28. @end