Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (39 sloc) 1.025 kb
d25dae0 @gabriel Refactoring
gabriel authored
1 //
2 // GHSenTestingTest.m
3 // GHUnit
4 //
5 // Created by Gabriel Handford on 1/21/09.
6 // Copyright 2009. All rights reserved.
7 //
8
c6c1fe3 @gabriel Disabling SenTest tests
gabriel authored
9 #define TEST_SENTEST 0
d25dae0 @gabriel Refactoring
gabriel authored
10
c6c1fe3 @gabriel Disabling SenTest tests
gabriel authored
11 #if TEST_SENTEST
d25dae0 @gabriel Refactoring
gabriel authored
12 #import <SenTestingKit/SenTestingKit.h>
13
14 // To test that we work with SenTestCase as well
15 @interface GHSenTestingTest : SenTestCase { }
16 @end
17
18 @implementation GHSenTestingTest
19
20 - (void)test {
e771172 @gabriel Tabs to spaces:
gabriel authored
21 STAssertTrue(YES, nil);
d25dae0 @gabriel Refactoring
gabriel authored
22 }
23
3438010 @gabriel Fixing tests
gabriel authored
24 - (void)testFail_EXPECTED {
e771172 @gabriel Tabs to spaces:
gabriel authored
25 STAssertTrue(NO, nil);
3438010 @gabriel Fixing tests
gabriel authored
26 }
27
28 @end
29
30 @interface GHSenTestFailWithException : SenTestCase {
e771172 @gabriel Tabs to spaces:
gabriel authored
31 BOOL _failWithException;
3438010 @gabriel Fixing tests
gabriel authored
32 }
d25dae0 @gabriel Refactoring
gabriel authored
33 @end
3438010 @gabriel Fixing tests
gabriel authored
34
35 @implementation GHSenTestFailWithException
36
37 - (void)failWithException:(NSException *)exception {
e771172 @gabriel Tabs to spaces:
gabriel authored
38 _failWithException = YES;
39 NSLog(@"Failed with exception: %@", exception);
3438010 @gabriel Fixing tests
gabriel authored
40 }
41
42 - (void)testFailWithException {
e771172 @gabriel Tabs to spaces:
gabriel authored
43 STFail(@"Fail");
44 NSAssert(_failWithException, @"failWithException: was overriden");
3438010 @gabriel Fixing tests
gabriel authored
45 }
46
47 - (void)testFailWithExceptionCall_EXPECTED {
e771172 @gabriel Tabs to spaces:
gabriel authored
48 [super failWithException:[NSException exceptionWithName:@"GHSenTestFailWithException" reason:@"Testing" userInfo:nil]];
3438010 @gabriel Fixing tests
gabriel authored
49 }
50
51 @end
52
514edfa @gabriel Adding new lines at EOF.
gabriel authored
53 #endif
Something went wrong with that request. Please try again.