Skip to content

Commit

Permalink
Merge pull request #27 from orchetect/dev
Browse files Browse the repository at this point in the history
Formatting
  • Loading branch information
orchetect authored Aug 6, 2021
2 parents 59770c1 + be4b478 commit e9c5f01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
16 changes: 5 additions & 11 deletions Sources/XCTestExtensions/XCTestCase+SwiftAssertThrows.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,15 @@
// MIDIKit • https://github.com/orchetect/MIDIKit
//

@import Foundation;
@import XCTest; // #import "XCTest/XCTest.h"
#import "Foundation/Foundation.h" // @import Foundation;
#import "XCTest/XCTest.h" // @import XCTest;

@interface XCTestCase(SwiftAssertThrows)

- (void) _XCTAssertThrows
:(void (^)(void))block;
- (void) _XCTAssertThrows:(void (^)(void))block;

- (void) _XCTAssertThrows
:(void (^)(void))block
:(NSString *)message;
- (void) _XCTAssertThrows:(void (^)(void))block :(NSString *)message;

- (void) _XCTAssertThrowsSpecific
:(void (^)(void))block
:(NSString *)name
:(NSString *)message;
- (void) _XCTAssertThrowsSpecific:(void (^)(void))block :(NSString *)name :(NSString *)message;

@end
12 changes: 3 additions & 9 deletions Sources/XCTestExtensions/XCTestCase+SwiftAssertThrows.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,17 @@

@implementation XCTestCase(SwiftAssertThrows)

- (void) _XCTAssertThrows
:(void (^)(void))block
- (void) _XCTAssertThrows:(void (^)(void))block
{
XCTAssertThrows(block(), "");
}

- (void) _XCTAssertThrows
:(void (^)(void))block
:(NSString *)message
- (void) _XCTAssertThrows:(void (^)(void))block :(NSString *)message
{
XCTAssertThrows(block(), @"%@", message);
}

- (void) _XCTAssertThrowsSpecific
:(void (^)(void))block
:(NSString *)exceptionName
:(NSString *)message
- (void) _XCTAssertThrowsSpecific:(void (^)(void))block :(NSString *)exceptionName :(NSString *)message
{
BOOL __didThrow = NO;
@try {
Expand Down

0 comments on commit e9c5f01

Please sign in to comment.