Skip to content

Commit d393490

Browse files
committed
Add test coverage for Response.
1 parent b40411a commit d393490

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/async/websocket/response.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2023, by Samuel Williams.
5+
6+
require 'async/websocket/response'
7+
8+
describe Async::WebSocket::Response do
9+
it "fails if the version is not recognized" do
10+
request = Protocol::HTTP::Request.new(nil, nil, "GET", "/", "frob/2.0")
11+
12+
expect do
13+
subject.for(request)
14+
end.to raise_exception(Async::WebSocket::ProtocolError, message: be =~ /Unsupported HTTP version/)
15+
end
16+
end

0 commit comments

Comments
 (0)