Skip to content

Commit df3c408

Browse files
committed
Fix test when upgrade is unsupported.
1 parent 40e8d01 commit df3c408

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
@@ -97,12 +97,13 @@ def test_streaming_enumerator(env)
9797
end
9898

9999
def test_websocket_echo(env)
100+
puts env.inspect
100101
Async::WebSocket::Adapters::Rack.open(env) do |connection|
101102
while message = connection.read
102103
connection.write(message)
103104
end
104105
connection.close
105-
end or Protocol::HTTP::Response[404, {}, []]
106+
end or [404, {}, []]
106107
end
107108

108109
private

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)