KWContainStringMatcher.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // KWContainStringMatcher.h
  3. // Kiwi
  4. //
  5. // Created by Kristopher Johnson on 4/28/13.
  6. // Copyright (c) 2013 Allen Ding. All rights reserved.
  7. //
  8. #import "KiwiConfiguration.h"
  9. #import "KWMatcher.h"
  10. // Kiwi matcher for determining whether a string contains an expected substring
  11. //
  12. // Examples:
  13. //
  14. // [[@"Hello, world!" should] containString:@"world"];
  15. // [[@"Hello, world!" shouldNot] containString:@"xyzzy"];
  16. //
  17. // [[@"Hello, world!" should] containString:@"WORLD"
  18. // options:NSCaseInsensitiveSearch];
  19. //
  20. // [[@"Hello, world!" should] startWithString:@"Hello,"];
  21. // [[@"Hello, world!" should] endWithString:@"world!"];
  22. @interface KWContainStringMatcher : KWMatcher
  23. // Match if subject contains specified substring
  24. - (void)containString:(NSString *)string;
  25. // Match if subject contains specified substring, using specified comparison options
  26. - (void)containString:(NSString *)string options:(NSStringCompareOptions)options;
  27. // Match if subject starts with the specified prefix
  28. - (void)startWithString:(NSString *)prefix;
  29. // Match if subject ends with the specified prefix
  30. - (void)endWithString:(NSString *)suffix;
  31. @end