Skip to content

Commit

Permalink
Add test for websocket extensions
Browse files Browse the repository at this point in the history
- fixing issue - #17
  • Loading branch information
moizsj committed Apr 21, 2016
1 parent dd5482a commit 8d455e1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/gniazdo/core_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,18 @@
(with-timeout (.acquire sem))
(is (= @result ["wamp"]))
(close conn)))

(deftest extensions-test
(let [result (atom nil)
sem (java.util.concurrent.Semaphore. 0)
conn (connect
uri
:extensions ["permessage-deflate"]
:on-connect (fn [^Session session]
(reset! result (.. session getUpgradeRequest getExtensions))
(.release sem)))]
(with-timeout (.acquire sem))
(is (-> @result
(.get 0)
(.getName)) "permessage-deflate")
(close conn)))

0 comments on commit 8d455e1

Please sign in to comment.