Fix failing Feedly tests.

This commit is contained in:
Kiel Gillard 2019-11-15 09:32:02 +11:00
parent a96c5f34ce
commit b317a99594
3 changed files with 7 additions and 1 deletions

View File

@ -102,6 +102,7 @@ class FeedlyOperationTests: XCTestCase {
func testOperationCancellationFlags() {
let testOperation = TestOperation()
testOperation.didCallMainExpectation = expectation(description: "Did Call Main")
testOperation.didCallMainExpectation?.isInverted = true
let completionExpectation = expectation(description: "Operation Completed")
testOperation.completionBlock = {

View File

@ -67,11 +67,13 @@ class FeedlySyncAllOperationTests: XCTestCase {
}
let syncCompletionExpectation = expectation(description: "Did Finish Sync")
syncCompletionExpectation.isInverted = true
syncAll.syncCompletionHandler = { result in
switch result {
case .success:
XCTFail("Expected failure.")
XCTFail("Sync operation was cancelled, not successful.")
case .failure:
XCTFail("Sync operation should cancel silently.")
break
}
syncCompletionExpectation.fulfill()

View File

@ -97,6 +97,9 @@ final class FeedlySyncAllOperation: FeedlyOperation {
super.cancel()
didFinish()
// Operation should silently cancel.
syncCompletionHandler = nil
}
override func main() {