forked from joecannatti/Objective-C-Koans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KWItNode.m
42 lines (32 loc) · 953 Bytes
/
KWItNode.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//
// Licensed under the terms in License.txt
//
// Copyright 2010 Allen Ding. All rights reserved.
//
#import "KWItNode.h"
#import "KWExampleNodeVisitor.h"
#import "KWExampleGroup.h"
#import "KWVerifying.h"
@implementation KWItNode
@synthesize exampleGroup;
#pragma mark -
#pragma mark Initializing
+ (id)itNodeWithCallSite:(KWCallSite *)aCallSite description:(NSString *)aDescription block:(KWVoidBlock)aBlock {
return [[[self alloc] initWithCallSite:aCallSite description:aDescription block:aBlock] autorelease];
}
#pragma mark -
#pragma mark Accepting Visitors
- (void)acceptExampleNodeVisitor:(id<KWExampleNodeVisitor>)aVisitor {
[aVisitor visitItNode:self];
}
#pragma mark -
#pragma mark Runtime Description support
- (NSString *)description
{
NSString *description = [super description];
if (description == nil) {
description = [self.exampleGroup generateDescriptionForAnonymousItNode];
}
return description;
}
@end