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