Last active
December 31, 2015 11:49
-
-
Save miwillhite/7982459 to your computer and use it in GitHub Desktop.
This file contains 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
ClearMocks(mockPackage, mockAsset) |
This file contains 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
#define ClearMocks(firstMock, ...) [SpecHelper clearMocks:firstMock, nil] | |
@interface SpecHelper : NSObject | |
+ (void)clearMocks:(id)firstMock, ...; | |
@end |
This file contains 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
#import "SpecHelper.h" | |
@implementation SpecHelper | |
+ (void)clearMocks:(id)firstMock, ... { | |
id mock; | |
va_list args; | |
if (firstMock) { | |
firstMock = nil; /* Handled separately */ | |
va_start(args, firstMock); | |
while((mock = va_arg(args, id))) | |
mock = nil; | |
va_end(args); | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment