Skip to content

Commit 4347af3

Browse files
committed
Fix test when upgrade is unsupported.
1 parent ee67f24 commit 4347af3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/rack/conform/application.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,13 @@ def test_streaming_enumerator(env)
9999
end
100100

101101
def test_websocket_echo(env)
102+
puts env.inspect
102103
Async::WebSocket::Adapters::Rack.open(env) do |connection|
103104
while message = connection.read
104105
connection.write(message)
105106
end
106107
connection.close
107-
end or Protocol::HTTP::Response[404, {}, []]
108+
end or [404, {}, []]
108109
end
109110

110111
def test_middleware_body_itself(env)

test/rack/conform/websocket.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
ensure
2323
connection.close
2424
end
25+
rescue Async::WebSocket::ProtocolError => error
26+
# It's acceptable to not support WebSockets.
27+
raise unless error.message == "Failed to negotiate connection: 404"
2528
end
2629
end

0 commit comments

Comments
 (0)