-
-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Milestone
Description
Hi again!
I opened this #46 issue some time ago.
Today i found a small bug, we forgot to forward arguments in the delegator #close method.
async-websocket/lib/async/websocket/client.rb
Lines 38 to 52 in cff18c0
class ClientCloseDecorator < SimpleDelegator | |
def initialize(client, connection) | |
@client = client | |
super(connection) | |
end | |
def close | |
super | |
if @client | |
@client.close | |
@client = nil | |
end | |
end | |
end |
Here are the arguments I was talking about
https://github.com/socketry/protocol-websocket/blob/58f0d15c6c5b44d224fd7a6eb237ce331bd8a587/lib/protocol/websocket/connection.rb#L62-L63
PeterRunich@3e7698d
i fixed it, but i didn't figure out how to write a test.
i think it should look similar like this test
async-websocket/test/async/websocket/client.rb
Lines 23 to 33 in cff18c0
it "can connect to a websocket server and close underlying client" do | |
Async do |task| | |
connection = Async::WebSocket::Client.connect(client_endpoint) | |
connection.send_text("Hello World!") | |
message = connection.read | |
expect(message.to_str).to be == "Hello World!" | |
connection.close | |
expect(task.children).to be(:empty?) | |
end.wait | |
end |
but i didn't figured out how to expect "moment of closing" on the server and comparing close codes, it would be nice if you explain it (or if it takes less of your time, you can write it yourself :) )
Metadata
Metadata
Assignees
Labels
No labels