aboutsummaryrefslogtreecommitdiffstats
path: root/test/utils/server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/utils/server.rb')
-rw-r--r--test/utils/server.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/utils/server.rb b/test/utils/server.rb
index afb9f57..5f1baa7 100644
--- a/test/utils/server.rb
+++ b/test/utils/server.rb
@@ -2,8 +2,8 @@ require "timeout"
module ServerUtils
def open_server_connection(scheme = :https)
- io = StringIO.new
- @_con = (scheme == :https ? HTTPSServerConnection : HTTPServerConnection).new(io)
+ @_io = StringIO.new
+ @_con = (scheme == :https ? ServerConnection : HTTPServerConnection).new(@_io.method(:write))
@_con << Connection::CLIENT_CONNECTION_PREFACE
@_con << Frame.new(type: :settings, stream_id: 0).assemble
if block_given?
@@ -30,8 +30,8 @@ module ServerUtils
end
end
- def sent_frames(con = nil)
- resp = (con || @_con).sock.string.dup.force_encoding(Encoding::BINARY)
+ def sent_frames(io = nil)
+ resp = (io || @_io).string.dup.force_encoding(Encoding::BINARY)
frames = []
while f = Frame.parse!(resp)
frames << f