Skip to content

Commit 663b730

Browse files
committed
Added tests for cluster options setting
1 parent 87dc115 commit 663b730

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/PusherSwiftTests.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,22 @@ class PusherClientInitializationSpec: QuickSpec {
334334
expect(pusher.connection.options.port).to(equal(123))
335335
}
336336
}
337+
338+
context("a cluster") {
339+
context("and no host") {
340+
it("sets the host correctly") {
341+
pusher = Pusher(key: key, options: ["cluster": "eu"])
342+
expect(pusher.connection.options.host).to(equal("ws-eu.pusher.com"))
343+
}
344+
}
345+
346+
context("and a host") {
347+
it("sets the host correctly") {
348+
pusher = Pusher(key: key, options: ["cluster": "eu", "host": "test.test.test"])
349+
expect(pusher.connection.options.host).to(equal("test.test.test"))
350+
}
351+
}
352+
}
337353
}
338354
}
339355
}

0 commit comments

Comments
 (0)