weak connection expection
This commit is contained in:
parent
dfc905d9c3
commit
e238293711
@ -20,10 +20,12 @@ class AbstractSocketTest: XCTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func openConnection() {
|
func openConnection() {
|
||||||
let expection = self.expectationWithDescription("connect")
|
weak var expection = self.expectationWithDescription("connect")
|
||||||
XCTAssertTrue(socket.status == SocketIOClientStatus.NotConnected)
|
XCTAssertTrue(socket.status == SocketIOClientStatus.NotConnected)
|
||||||
socket.on("connect") {data, ack in
|
socket.on("connect") {data, ack in
|
||||||
expection.fulfill()
|
if let expection = expection {
|
||||||
|
expection.fulfill()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
socket.connect()
|
socket.connect()
|
||||||
XCTAssertEqual(socket.status, SocketIOClientStatus.Connecting)
|
XCTAssertEqual(socket.status, SocketIOClientStatus.Connecting)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user