Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jul 2, 2024
1 parent 40e8d01 commit 0569aba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rack/conform/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,13 @@ def test_streaming_enumerator(env)
end

def test_websocket_echo(env)
puts env.inspect
Async::WebSocket::Adapters::Rack.open(env) do |connection|
while message = connection.read
connection.write(message)
end
connection.close
end or Protocol::HTTP::Response[404, {}, []]
end or [404, {}, []]
end

private
Expand Down
3 changes: 3 additions & 0 deletions test/rack/conform/websocket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@
ensure
connection.close
end
rescue Async::WebSocket::ProtocolError => error
# It's acceptable to not support WebSockets.
raise unless error.message == "Failed to negotiate connection: 404"
end
end

0 comments on commit 0569aba

Please sign in to comment.