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
func testCleanup() { | |
// Extend your class inline in order to add closure property `deinitCalled`, | |
// which indicates when/if your class's deinit() gets called | |
class ClassUnderTest: CLASS_YOU_WANT_TO_TEST { | |
var deinitCalled: (() -> Void)? | |
deinit { deinitCalled?() } | |
} | |
// Set up async expectation, which causes the test to wait for `deinitCalled` |
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
// | |
// Created by Alex Manarpies on 12/17/14. | |
// | |
#import <Foundation/Foundation.h> | |
/** | |
* Utility class for maintaining a moving average over a given time period. | |
* Credits: http://stackoverflow.com/a/14740836/331283 |
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 <Specta.h> | |
#define EXP_SHORTHAND | |
#import <Expecta.h> | |
#import <CoreData/CoreData.h> | |
SpecBegin(CoreDataInMemorySetupExample) | |
__block NSManagedObjectContext *context; | |
beforeAll(^{ | |
// ObjectModel from any models in app bundle |
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
public protocol FileParser { | |
func parse(string: String) -> [Entry] | |
} | |
public struct FileParserFactory { | |
public static func unordered() -> FileParser { | |
UnorderedFileParser() | |
} | |
public static func ordered() -> FileParser { | |
LineOrderedFileParser(unorderedParser: unordered()) |
OlderNewer