Skip to content

Commit

Permalink
Added initWithGroup to GHTestGroup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Inferis committed Jan 24, 2012
1 parent fea526d commit 776290c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/GHTest/GHTestGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
*/
- (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id<GHTestDelegate>)delegate;


- (id)initWithGroup:(GHTestGroup*)group test:(id<GHTest>)test;


/*!
Create test group from a test case.
@param testCase Test case, could be a subclass of SenTestCase or GHTestCase
Expand Down
10 changes: 10 additions & 0 deletions Classes/GHTest/GHTestGroup.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@ - (id)initWithTestCase:(id)testCase selector:(SEL)selector delegate:(id<GHTestDe
return self;
}

- (id)initWithGroup:(GHTestGroup*)group test:(id<GHTest>)test {
if ((self = [super init])) {
name_ = [group.name retain];
children_ = [[NSMutableArray arrayWithObject:test] retain];
delegate_ = group.delegate;
testCase_ = group.testCase;
}
return self;
}

+ (GHTestGroup *)testGroupFromTestCase:(id)testCase delegate:(id<GHTestDelegate>)delegate {
return [[[GHTestGroup alloc] initWithTestCase:testCase delegate:delegate] autorelease];
}
Expand Down

0 comments on commit 776290c

Please sign in to comment.