Merge pull request #1296 from kielgillard/failing-tests

Fix failing Feedly tests.
This commit is contained in:
Maurice Parker 2019-11-14 16:44:21 -06:00 committed by GitHub
commit 6e8d1a90a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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() {