File tree Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Expand file tree Collapse file tree 2 files changed +26
8000
-12
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ def initialize(client, connection)
41
41
super ( connection )
42
42
end
43
43
44
- def close
45
- super
44
+ def close ( ... )
45
+ super ( ... )
46
46
47
47
if @client
48
48
@client . close
Original file line number Diff line number Diff line change 20
20
end
21
21
end
22
22
23
- it "can connect to a websocket server and close underlying client" do
24
- Async do |task |
25
- connection = Async ::WebSocket ::Client . connect ( client_endpoint )
26
- connection . send_text ( "Hello World!" )
27
- message = connection . read
28
- expect ( message . to_str ) . to be == "Hello World!"
29
-
30
- connection . close
31
- expect ( task . children ) . to be ( :empty? )
32
- end . wait
23
+ with '#close' do
24
+ it "can connect to a websocket server and close underlying client" do
25
+ Async do |task |
26
+ connection = Async ::WebSocket ::Client . connect ( client_endpoint )
27
+ connection . send_text ( "Hello World!" )
28
+ message = connection . read
29
+ expect ( message . to_str ) . to be == "Hello World!"
30
+
31
+ connection . close
32
+ expect ( task . children ) . to be ( :empty? )
33
+ end . wait
34
+ end
35
+
36
+ it "can connect to a websocket server and close underlying client with an error code" do
37
+ Async do |task |
38
+ connection = Async ::WebSocket ::Client . connect ( client_endpoint )
39
+ connection . send_text ( "Hello World!" )
40
+ message = connection . read
41
+ expect ( message . to_str ) . to be == "Hello World!"
42
+
43
+ connection . close ( Protocol ::WebSocket ::Error ::GOING_AWAY , "Bye!" )
44
+ expect ( task . children ) . to be ( :empty? )
45
+ end . wait
46
+ end
33
47
end
34
48
35
49
with 'missing support for websockets' do
You can’t perform that action at this time.
0 commit comments