Merge pull request #1296 from kielgillard/failing-tests
Fix failing Feedly tests.
This commit is contained in:
commit
6e8d1a90a8
|
@ -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 = {
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -97,6 +97,9 @@ final class FeedlySyncAllOperation: FeedlyOperation {
|
|||
super.cancel()
|
||||
|
||||
didFinish()
|
||||
|
||||
// Operation should silently cancel.
|
||||
syncCompletionHandler = nil
|
||||
}
|
||||
|
||||
override func main() {
|
||||
|
|
Loading…
Reference in New Issue