Make test less brittle

This commit is contained in:
Blake Watters
2012-11-09 12:11:58 -05:00
parent e088bdc186
commit 2aeb07d47a

View File

@@ -322,12 +322,11 @@
}];
expect(_objectManager.operationQueue).notTo.beNil();
[_objectManager.operationQueue waitUntilAllOperationsAreFinished];
// Spin the run loop to allow completion blocks to fire after operations have completed
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.02]];
expect(progressCallbackCount).to.equal(3);
expect(completionBlockOperationCount).to.equal(3);
dispatch_async(dispatch_get_main_queue(), ^{
expect(progressCallbackCount).to.equal(3);
expect(completionBlockOperationCount).to.equal(3);
});
}
- (void)testShouldProperlyFireABatchOfOperationsFromRoute