KWContextNode.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // Licensed under the terms in License.txt
  3. //
  4. // Copyright 2010 Allen Ding. All rights reserved.
  5. //
  6. #import "KiwiConfiguration.h"
  7. #import "KWExampleNode.h"
  8. @class KWAfterAllNode;
  9. @class KWAfterEachNode;
  10. @class KWBeforeAllNode;
  11. @class KWBeforeEachNode;
  12. @class KWCallSite;
  13. @class KWLetNode;
  14. @class KWItNode;
  15. @class KWPendingNode;
  16. @class KWRegisterMatchersNode;
  17. @class KWExample;
  18. @interface KWContextNode : NSObject<KWExampleNode>
  19. #pragma mark - Initializing
  20. - (id)initWithCallSite:(KWCallSite *)aCallSite parentContext:(KWContextNode *)node description:(NSString *)aDescription;
  21. + (id)contextNodeWithCallSite:(KWCallSite *)aCallSite parentContext:(KWContextNode *)contextNode description:(NSString *)aDescription;
  22. #pragma mark - Getting Call Sites
  23. @property (nonatomic, weak, readonly) KWCallSite *callSite;
  24. #pragma mark - Getting Descriptions
  25. @property (readonly, copy) NSString *description;
  26. #pragma mark - Managing Nodes
  27. @property (nonatomic, strong) KWBeforeAllNode *beforeAllNode;
  28. @property (nonatomic, strong) KWAfterAllNode *afterAllNode;
  29. @property (nonatomic, strong) KWBeforeEachNode *beforeEachNode;
  30. @property (nonatomic, strong) KWAfterEachNode *afterEachNode;
  31. @property (nonatomic, readonly) NSArray *nodes;
  32. @property (nonatomic, readonly) NSArray *registerMatchersNodes;
  33. @property (nonatomic, readonly) NSArray *letNodes;
  34. @property (nonatomic, readonly) KWContextNode *parentContext;
  35. @property (nonatomic, assign) BOOL isFocused;
  36. - (void)addContextNode:(KWContextNode *)aNode;
  37. - (void)addLetNode:(KWLetNode *)aNode;
  38. - (void)addRegisterMatchersNode:(KWRegisterMatchersNode *)aNode;
  39. - (void)addItNode:(KWItNode *)aNode;
  40. - (void)addPendingNode:(KWPendingNode *)aNode;
  41. - (KWLetNode *)letNodeTree;
  42. - (void)performExample:(KWExample *)example withBlock:(void (^)(void))exampleBlock;
  43. #pragma mark - Accepting Visitors
  44. - (void)acceptExampleNodeVisitor:(id<KWExampleNodeVisitor>)aVisitor;
  45. @end