Skip to content

Commit

Permalink
RTL4i
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardopereira committed Nov 30, 2016
1 parent f130328 commit 8511bef
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions Spec/RealtimeClientChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,48 @@ class RealtimeClientChannel: QuickSpec {
}
}
}

// RTL4i
it("if the connection state is INITIALIZED do the operation once the connection state is CONNECTED") {
let options = AblyTests.commonAppSetup()
options.autoConnect = false
let client = ARTRealtime(options: options)
defer { client.dispose(); client.close() }
let channel = client.channels.get("foo")
waitUntil(timeout: testTimeout) { done in
channel.attach() { error in
expect(error).to(beNil())
done()
}
}
}

// RTL4i
it("if the connection state is CONNECTING do the operation once the connection state is CONNECTED") {
let client = ARTRealtime(options: AblyTests.commonAppSetup())
defer { client.dispose(); client.close() }
let channel = client.channels.get("foo")
waitUntil(timeout: testTimeout) { done in
channel.attach() { error in
expect(error).to(beNil())
done()
}
}
}

// RTL4i
it("if the connection state is DISCONNECTED do the operation once the connection state is CONNECTED") {
let client = ARTRealtime(options: AblyTests.commonAppSetup())
defer { client.dispose(); client.close() }
let channel = client.channels.get("foo")
client.onDisconnected()
waitUntil(timeout: testTimeout) { done in
channel.attach() { error in
expect(error).to(beNil())
done()
}
}
}
}

describe("detach") {
Expand Down

0 comments on commit 8511bef

Please sign in to comment.