diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-08 21:03:25 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-05-08 21:13:01 +0900 |
commit | cc5d3be0fd0b2794fd1149308e4071fc25fe7a44 (patch) | |
tree | a195c4d5a68cf3d6e9bdaa792dbe474318b20726 /test/plum/server/test_http_connection.rb | |
parent | 26ec6b88a8e078499835851a0310eba486475b7b (diff) | |
download | plum-cc5d3be0fd0b2794fd1149308e4071fc25fe7a44.tar.gz |
frame: create subclasses for each frame type
This improves code readability.
Diffstat (limited to 'test/plum/server/test_http_connection.rb')
-rw-r--r-- | test/plum/server/test_http_connection.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/plum/server/test_http_connection.rb b/test/plum/server/test_http_connection.rb index 1326deb..e03523b 100644 --- a/test/plum/server/test_http_connection.rb +++ b/test/plum/server/test_http_connection.rb @@ -9,7 +9,7 @@ class HTTPConnectionNegotiationTest < Minitest::Test con = HTTPServerConnection.new(io.method(:write)) con << Connection::CLIENT_CONNECTION_PREFACE assert_connection_error(:protocol_error) { - con << Frame.new(type: :window_update, stream_id: 0, payload: "".push_uint32(1)).assemble + con << Frame::WindowUpdate.new(0, 1).assemble } end @@ -20,7 +20,7 @@ class HTTPConnectionNegotiationTest < Minitest::Test assert_no_error { con << magic[0...5] con << magic[5..-1] - con << Frame.new(type: :settings, stream_id: 0).assemble + con << Frame::Settings.new.assemble } end @@ -41,7 +41,7 @@ class HTTPConnectionNegotiationTest < Minitest::Test assert(io.string.include?("HTTP/1.1 101 "), "Response is not HTTP/1.1 101: #{io.string}") assert_no_error { con << Connection::CLIENT_CONNECTION_PREFACE - con << Frame.new(type: :settings, stream_id: 0).assemble + con << Frame::Settings.new.assemble } assert_equal(:half_closed_remote, con.streams[1].state) assert_equal({ ":method" => "GET", ":path" => "/", ":authority" => "rhe.jp", "user-agent" => "nya"}, heads) |