Created
September 18, 2013 12:08
-
-
Save tibr/6608259 to your computer and use it in GitHub Desktop.
SenTestingKit => XCTestCase exception handling
This file contains hidden or 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
- (void)failWithException:(NSException *)exception | |
{ | |
NSRange firstColonRange = [exception.reason rangeOfString:@":"]; | |
NSString *filename = [exception.reason substringToIndex:firstColonRange.location]; | |
NSString *secondPart = [exception.reason substringFromIndex:firstColonRange.location + firstColonRange.length]; | |
NSRange lineSeparatorRange = [secondPart rangeOfString:@" "]; | |
NSString *lineString = [secondPart substringToIndex:lineSeparatorRange.location]; | |
NSString *description = [secondPart substringFromIndex:lineSeparatorRange.location + lineSeparatorRange.length]; | |
[self recordFailureWithDescription:description | |
inFile:filename | |
atLine:[lineString integerValue] | |
expected:NO]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment