Sha256: 8f80c9672161d2bfba4a988d2c003f5782935da4af8ed99df370f474e36ecf48
Contents?: true
Size: 1.07 KB
Versions: 8
Compression:
Stored size: 1.07 KB
Contents
#import "EXPMatchers+raise.h" #import "EXPDefines.h" EXPMatcherImplementationBegin(raise, (NSString *expectedExceptionName)) { __block NSException *exceptionCaught = nil; match(^BOOL{ BOOL expectedExceptionCaught = NO; @try { ((EXPBasicBlock)actual)(); } @catch(NSException *e) { exceptionCaught = e; expectedExceptionCaught = (expectedExceptionName == nil) || [[exceptionCaught name] isEqualToString:expectedExceptionName]; } return expectedExceptionCaught; }); failureMessageForTo(^NSString *{ return [NSString stringWithFormat:@"expected: %@, got: %@", expectedExceptionName ? expectedExceptionName : @"any exception", exceptionCaught ? [exceptionCaught name] : @"no exception"]; }); failureMessageForNotTo(^NSString *{ return [NSString stringWithFormat:@"expected: %@, got: %@", expectedExceptionName ? [NSString stringWithFormat:@"not %@", expectedExceptionName] : @"no exception", exceptionCaught ? [exceptionCaught name] : @"no exception"]; }); } EXPMatcherImplementationEnd
Version data entries
8 entries across 8 versions & 2 rubygems