forked from kiwi-bdd/Kiwi
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marin Usalj
committed
Jan 24, 2013
1 parent
11dd4e3
commit 63fe50e
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// | ||
// KWFunctionalTests.m | ||
// Kiwi | ||
// | ||
// Created by Marin Usalj on 1/24/13. | ||
// Copyright (c) 2013 Allen Ding. All rights reserved. | ||
// | ||
|
||
#import "Kiwi.h" | ||
#import "KiwiTestConfiguration.h" | ||
#import "TestClasses.h" | ||
|
||
#if KW_TESTS_ENABLED | ||
|
||
@interface KWFunctionalTests : SenTestCase | ||
@end | ||
|
||
@implementation KWFunctionalTests | ||
|
||
- (void)testInnerContextsAreExecuted { | ||
NSMutableArray *calls = @[@"OuterTestCase", | ||
@"BeforeAll", @"AfterAll", @"BeforeEach", @"AfterEach", @"TestCase", | ||
@"InnerBeforeAll", @"InnerAfterAll", @"InnerBeforeEach", @"InnerAfterEach", @"InnerTestCase", | ||
@"DoubleInnerBeforeAll", @"DoubleInnerAfterAll", @"DoubleInnerBeforeEach", @"DoubleInnerAfterEach", @"DoubleInnerTestCase" | ||
].mutableCopy; | ||
|
||
describe(@"OuterDescribe", ^{ | ||
it(@"OuterTestCase", ^{ [calls removeObject:@"OuterTestCase"]; }); | ||
context(@"OuterContext", ^{ | ||
beforeAll(^{ [calls removeObject:@"BeforeAll"]; }); | ||
afterAll(^{ [calls removeObject:@"AfterAll"]; }); | ||
beforeEach(^{ [calls removeObject:@"BeforeEach"]; }); | ||
afterEach(^{ [calls removeObject:@"AfterEach"]; }); | ||
it(@"TestCase", ^{ [calls removeObject:@"TestCase"]; }); | ||
context(@"Context", ^{ | ||
beforeAll(^{ [calls removeObject:@"InnerBeforeAll"]; }); | ||
afterAll(^{ [calls removeObject:@"InnerAfterAll"]; }); | ||
beforeEach(^{ [calls removeObject:@"InnerBeforeEach"]; }); | ||
afterEach(^{ [calls removeObject:@"InnerAfterEach"]; }); | ||
it(@"InnerTestCase", ^{ [calls removeObject:@"InnerTestCase"]; }); | ||
context(@"InnerContext", ^{ | ||
beforeAll(^{ [calls removeObject:@"DoubleInnerBeforeAll"]; }); | ||
afterAll(^{ [calls removeObject:@"DoubleInnerAfterAll"]; }); | ||
beforeEach(^{ [calls removeObject:@"DoubleInnerBeforeEach"]; }); | ||
afterEach(^{ [calls removeObject:@"DoubleInnerAfterEach"]; }); | ||
it(@"DoubleInnerTestCase", ^{ [calls removeObject:@"DoubleInnerTestCase"]; }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
STAssertEquals(0, calls.count, @"Not all the blocks were called! Leftovers: %@", calls); | ||
} | ||
|
||
@end | ||
|
||
#endif // #if KW_TESTS_ENABLED |