Skip to content

Commit

Permalink
Moved core functionality from KIFTestCase to SenTestCase (KIFAdditions).
Browse files Browse the repository at this point in the history
  • Loading branch information
bnickel committed Aug 23, 2013
1 parent a6c5cc8 commit d8f0d80
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 17 deletions.
14 changes: 14 additions & 0 deletions Additions/SenTestCase-KIFAdditions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// SenTestCase-KIFAdditions.h
// KIF
//
// Created by Brian Nickel on 8/23/13.
//
//

#import <SenTestingKit/SenTestingKit.h>
#import "KIFTestActor.h"

@interface SenTestCase (KIFAdditions) <KIFTestActorDelegate>

@end
30 changes: 30 additions & 0 deletions Additions/SenTestCase-KIFAdditions.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// SenTestCase-KIFAdditions.m
// KIF
//
// Created by Brian Nickel on 8/23/13.
//
//

#import "SenTestCase-KIFAdditions.h"

@implementation SenTestCase (KIFAdditions)

- (void)failWithException:(NSException *)exception stopTest:(BOOL)stop
{
if (stop) {
[self raiseAfterFailure];
}
[self failWithException:exception];
[self continueAfterFailure];
}

- (void)failWithExceptions:(NSArray *)exceptions stopTest:(BOOL)stop
{
NSException *lastException = exceptions.lastObject;
for (NSException *exception in exceptions) {
[self failWithException:exception stopTest:(exception == lastException ? stop : NO)];
}
}

@end
2 changes: 2 additions & 0 deletions Classes/KIF.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
#import "KIFTestCase.h"
#import "KIFSystemTestActor.h"
#import "KIFUITestActor.h"

#import "SenTestCase-KIFAdditions.h"
4 changes: 2 additions & 2 deletions Classes/KIFTestCase.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
// which Square, Inc. licenses this file to you.

#import <SenTestingKit/SenTestingKit.h>
#import "KIFTestActor.h"
#import "SenTestCase-KIFAdditions.h"

@interface KIFTestCase : SenTestCase <KIFTestActorDelegate>
@interface KIFTestCase : SenTestCase

- (void)beforeAll;
- (void)beforeEach;
Expand Down
16 changes: 2 additions & 14 deletions Classes/KIFTestCase.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,8 @@ - (void)failWithException:(NSException *)exception stopTest:(BOOL)stop
[waiter waitForTimeInterval:[[NSDate distantFuture] timeIntervalSinceNow]];

return;
}

if (!stop) {
[self continueAfterFailure];
}
[self failWithException:exception];
[self raiseAfterFailure];
}

- (void)failWithExceptions:(NSArray *)exceptions stopTest:(BOOL)stop
{
NSException *lastException = exceptions.lastObject;
for (NSException *exception in exceptions) {
[self failWithException:exception stopTest:(exception == lastException ? stop : NO)];
} else {
[super failWithException:exception stopTest:stop];
}
}

Expand Down
2 changes: 1 addition & 1 deletion KIF Tests/SystemTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <KIF/KIF.h>

@interface SystemTests : KIFTestCase
@interface SystemTests : SenTestCase
@end

@implementation SystemTests
Expand Down
8 changes: 8 additions & 0 deletions KIF.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
EBAE488217A460E50005EE19 /* NSError-KIFAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = EBAE488017A460E50005EE19 /* NSError-KIFAdditions.m */; };
EBAE488717A4E5C30005EE19 /* KIFTestStepValidation.h in Headers */ = {isa = PBXBuildFile; fileRef = EBAE488517A4E5C30005EE19 /* KIFTestStepValidation.h */; settings = {ATTRIBUTES = (Public, ); }; };
EBAE488817A4E5C30005EE19 /* KIFTestStepValidation.m in Sources */ = {isa = PBXBuildFile; fileRef = EBAE488617A4E5C30005EE19 /* KIFTestStepValidation.m */; };
EBAFFF3817C7C824003E3A1C /* SenTestCase-KIFAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = EBAFFF3617C7C824003E3A1C /* SenTestCase-KIFAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
EBAFFF3917C7C824003E3A1C /* SenTestCase-KIFAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = EBAFFF3717C7C824003E3A1C /* SenTestCase-KIFAdditions.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -163,6 +165,8 @@
EBAE488017A460E50005EE19 /* NSError-KIFAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSError-KIFAdditions.m"; sourceTree = "<group>"; };
EBAE488517A4E5C30005EE19 /* KIFTestStepValidation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KIFTestStepValidation.h; sourceTree = "<group>"; };
EBAE488617A4E5C30005EE19 /* KIFTestStepValidation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KIFTestStepValidation.m; sourceTree = "<group>"; };
EBAFFF3617C7C824003E3A1C /* SenTestCase-KIFAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "SenTestCase-KIFAdditions.h"; sourceTree = "<group>"; };
EBAFFF3717C7C824003E3A1C /* SenTestCase-KIFAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "SenTestCase-KIFAdditions.m"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -284,6 +288,8 @@
EBAE487B17A45A8E0005EE19 /* NSBundle-KIFAdditions.m */,
EBAE487F17A460E50005EE19 /* NSError-KIFAdditions.h */,
EBAE488017A460E50005EE19 /* NSError-KIFAdditions.m */,
EBAFFF3617C7C824003E3A1C /* SenTestCase-KIFAdditions.h */,
EBAFFF3717C7C824003E3A1C /* SenTestCase-KIFAdditions.m */,
);
path = Additions;
sourceTree = "<group>";
Expand Down Expand Up @@ -385,6 +391,7 @@
EB72045F1680DDAD00278DA2 /* UIWindow-KIFAdditions.h in Headers */,
EB7204601680DDAD00278DA2 /* NSFileManager-KIFAdditions.h in Headers */,
EB7204611680DDAD00278DA2 /* LoadableCategory.h in Headers */,
EBAFFF3817C7C824003E3A1C /* SenTestCase-KIFAdditions.h in Headers */,
EB7204621680DDAD00278DA2 /* KIFTypist.h in Headers */,
EB7204631680DDAD00278DA2 /* KIFTestActor.h in Headers */,
EB7204641680DDAD00278DA2 /* KIFTestCase.h in Headers */,
Expand Down Expand Up @@ -588,6 +595,7 @@
EB72044D1680DDAD00278DA2 /* KIFTestCase.m in Sources */,
EB72044E1680DDAD00278DA2 /* KIFSystemTestActor.m in Sources */,
EB72044F1680DDAD00278DA2 /* KIFUITestActor.m in Sources */,
EBAFFF3917C7C824003E3A1C /* SenTestCase-KIFAdditions.m in Sources */,
EBAE487D17A45A8E0005EE19 /* NSBundle-KIFAdditions.m in Sources */,
EBAE488217A460E50005EE19 /* NSError-KIFAdditions.m in Sources */,
EBAE488817A4E5C30005EE19 /* KIFTestStepValidation.m in Sources */,
Expand Down

0 comments on commit d8f0d80

Please sign in to comment.