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 fetchNotificationsNotMatchingEtag(etag: String?, includeReadNotifications includeRead: Bool, updatedSince since: NSDate?) -> SignalProducer<OCTResponse, NSError> { | |
let signal = fetchNotificationsNotMatchingEtag(etag, includeReadNotifications: includeRead, updatedSince: since) | |
return signal.toSignalProducer() | |
|> map { $0 as! OCTResponse } | |
} |
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
- (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]; |
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
UIView *scrollViewWidthEnforcer = [UIView new]; | |
[scrollViewWidthEnforcer setTranslatesAutoresizingMaskIntoConstraints:NO]; | |
[self.scrollView addSubview:scrollViewWidthEnforcer]; | |
[self.scrollView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[enforcer(==scrollView)]|" | |
options:0 | |
metrics:nil | |
views:@{ | |
@"enforcer" : scrollViewWidthEnforcer, | |
@"scrollView" : self.scrollView | |
}]]; |
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
context(@"success", ^{ | |
beforeEach(^{ | |
[OHHTTPStubs shouldStubRequestsPassingTest:^BOOL(NSURLRequest *request) { | |
NSString *expectedPath = @"/3/configuration"; | |
BOOL shouldStub = [[request.URL path] isEqualToString:expectedPath]; | |
return shouldStub; | |
} withStubResponse:^OHHTTPStubsResponse *(NSURLRequest *request) { | |
OHHTTPStubsResponse *response = [OHHTTPStubsResponse responseWithFile:@"configuration.json" | |
contentType:@"application/json" |
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
it(@"should start the processing with the ids from the network response", ^{ | |
// mock network request | |
[KWSpec canResponseJSON:@"ids"]; | |
// execute code under test | |
[client syncMyStuff]; | |
// create mock | |
id process = [ProcessingOperation mock]; | |
// return mock by stubbing alloc |
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
@interface NSFileManager (DoNotBackup) | |
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL; | |
@end |