Fix test failures by cancelling operations with the queue. It seems operations no longer can cancel themselves.
This commit is contained in:
parent
f7017aaed5
commit
f14ba07740
@ -55,7 +55,7 @@ class FeedlyCheckpointOperationTests: XCTestCase {
|
|||||||
|
|
||||||
MainThreadOperationQueue.shared.addOperation(operation)
|
MainThreadOperationQueue.shared.addOperation(operation)
|
||||||
|
|
||||||
operation.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([operation])
|
||||||
|
|
||||||
waitForExpectations(timeout: 1)
|
waitForExpectations(timeout: 1)
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ class FeedlyLogoutOperationTests: XCTestCase {
|
|||||||
|
|
||||||
MainThreadOperationQueue.shared.addOperation(logout)
|
MainThreadOperationQueue.shared.addOperation(logout)
|
||||||
|
|
||||||
logout.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([logout])
|
||||||
|
|
||||||
waitForExpectations(timeout: 1)
|
waitForExpectations(timeout: 1)
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class FeedlyOperationTests: XCTestCase {
|
|||||||
|
|
||||||
MainThreadOperationQueue.shared.addOperation(testOperation)
|
MainThreadOperationQueue.shared.addOperation(testOperation)
|
||||||
|
|
||||||
testOperation.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([testOperation])
|
||||||
|
|
||||||
waitForExpectations(timeout: 2)
|
waitForExpectations(timeout: 2)
|
||||||
|
|
||||||
@ -180,8 +180,8 @@ class FeedlyOperationTests: XCTestCase {
|
|||||||
MainThreadOperationQueue.shared.addOperation(testOperation)
|
MainThreadOperationQueue.shared.addOperation(testOperation)
|
||||||
|
|
||||||
XCTAssertTrue(progress.numberRemaining == 1)
|
XCTAssertTrue(progress.numberRemaining == 1)
|
||||||
testOperation.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([testOperation])
|
||||||
XCTAssertTrue(progress.numberRemaining == 1)
|
XCTAssertTrue(progress.numberRemaining == 0)
|
||||||
|
|
||||||
waitForExpectations(timeout: 2)
|
waitForExpectations(timeout: 2)
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class FeedlyRefreshAccessTokenOperationTests: XCTestCase {
|
|||||||
|
|
||||||
MainThreadOperationQueue.shared.addOperation(refresh)
|
MainThreadOperationQueue.shared.addOperation(refresh)
|
||||||
|
|
||||||
refresh.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([refresh])
|
||||||
|
|
||||||
waitForExpectations(timeout: 1)
|
waitForExpectations(timeout: 1)
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ class FeedlyUpdateAccountFeedsWithItemsOperationTests: XCTestCase {
|
|||||||
|
|
||||||
MainThreadOperationQueue.shared.addOperation(update)
|
MainThreadOperationQueue.shared.addOperation(update)
|
||||||
|
|
||||||
update.cancel()
|
MainThreadOperationQueue.shared.cancelOperations([update])
|
||||||
|
|
||||||
waitForExpectations(timeout: 2)
|
waitForExpectations(timeout: 2)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user