diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2019-10-13 21:25:12 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2019-10-13 21:25:12 +0800 |
commit | 7b8f403a0d3f95a825a09a709bc17a694952683d (patch) | |
tree | 053aa1f8e1f7d75df69597c6fb81fddd4acd1411 /example/websockets | |
parent | 114b385269c6f5049615e67c8c42dc25be337626 (diff) | |
download | cask-7b8f403a0d3f95a825a09a709bc17a694952683d.tar.gz cask-7b8f403a0d3f95a825a09a709bc17a694952683d.tar.bz2 cask-7b8f403a0d3f95a825a09a709bc17a694952683d.zip |
fix tests
Diffstat (limited to 'example/websockets')
-rw-r--r-- | example/websockets/app/test/src/ExampleTests.scala | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/example/websockets/app/test/src/ExampleTests.scala b/example/websockets/app/test/src/ExampleTests.scala index e8889b0..413937d 100644 --- a/example/websockets/app/test/src/ExampleTests.scala +++ b/example/websockets/app/test/src/ExampleTests.scala @@ -39,14 +39,13 @@ object ExampleTests extends TestSuite{ Thread.sleep(100) out ==> List("haoyi world", "haoyi hello") - var error: String = "" - val ws2 = cask.WsClient.connect("ws://localhost:8080/connect/nobody") { - case cask.Ws.Text(s) => out = s :: out - case cask.Ws.Error(t) => error += t.toString - case cask.Ws.Close(code, reason) => error += reason + val ex = intercept[Exception] { + cask.WsClient.connect("ws://localhost:8080/connect/nobody") { + case _ => /*do nothing*/ + } } + assert(ex.getMessage.contains("403")) - assert(error.contains("403")) }finally ws.close() } |