Skip to content

Commit

Permalink
RTN4e (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira authored and tcard committed Sep 7, 2016
1 parent 237cfe7 commit cd5ffe6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Spec/RealtimeClientConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,28 @@ class RealtimeClientConnection: QuickSpec {
}
}

// RTN4e
it("should have a ConnectionStateChange as first argument for every connection state change") {
let options = AblyTests.commonAppSetup()
options.autoConnect = false
let client = ARTRealtime(options: options)
defer { client.dispose(); client.close() }

waitUntil(timeout: testTimeout) { done in
client.connection.once(.Connected) { stateChange in
guard let stateChange = stateChange else {
fail("ConnectionStateChange is empty"); done()
return
}
expect(stateChange).to(beAKindOf(ARTConnectionStateChange))
expect(stateChange.current).to(equal(ARTRealtimeConnectionState.Connected))
expect(stateChange.previous).to(equal(ARTRealtimeConnectionState.Connecting))
done()
}
client.connect()
}
}

// RTN4f
it("should have the reason which contains an ErrorInfo") {
let options = AblyTests.commonAppSetup()
Expand Down

0 comments on commit cd5ffe6

Please sign in to comment.