weak connection expection

This commit is contained in:
Lukas Schmidt 2015-09-03 13:49:27 +02:00
parent dfc905d9c3
commit e238293711

View File

@ -20,10 +20,12 @@ 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
expection.fulfill()
if let expection = expection {
expection.fulfill()
}
}
socket.connect()
XCTAssertEqual(socket.status, SocketIOClientStatus.Connecting)