Skip to content

Commit 0ad1e38

Browse files
committed
Update tests
1 parent 3c96615 commit 0ad1e38

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

RxHttpClientTests/Fake.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class FakeDataTask : NSObject, URLSessionDataTaskType {
3030

3131
open func cancel() {
3232
if !isCancelled {
33+
state = .suspended
34+
isCancelled = true
3335
cancelClosure?(self)
34-
state = .suspended
35-
isCancelled = true
3636
}
3737
}
3838
}

RxHttpClientTests/HttpClientBasicTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class HttpClientBasicTests: XCTestCase {
2626
func testTerminateRequest() {
2727
let fakeSession = FakeSession()
2828
let cancelExpectation = expectation(description: "Should cancel task")
29+
cancelExpectation.assertForOverFulfill = false
2930
let resumeExpectation = expectation(description: "Should start task")
3031
fakeSession.task = FakeDataTask(resumeClosure: { _ in resumeExpectation.fulfill() }, cancelClosure: { _ in cancelExpectation.fulfill() })
3132
let client = HttpClient(session: fakeSession)

0 commit comments

Comments
 (0)