From 3466b54b14cc2d4ce3d1db6af1bc282678bab443 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Wed, 11 Nov 2015 14:16:47 +0900 Subject: connection: split large frame in #send_immediately --- test/utils/server.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'test/utils') diff --git a/test/utils/server.rb b/test/utils/server.rb index be2aba6..82ed9ad 100644 --- a/test/utils/server.rb +++ b/test/utils/server.rb @@ -39,8 +39,7 @@ module ServerUtils frames end - def capture_frames(con = nil, &blk) - io = (con || @_con).sock + def parse_frames(io, &blk) pos = io.string.bytesize blk.call resp = io.string.byteslice(pos, io.string.bytesize - pos).force_encoding(Encoding::BINARY) @@ -51,8 +50,8 @@ module ServerUtils frames end - def capture_frame(con = nil, &blk) - frames = capture_frames(con, &blk) + def parse_frame(io, &blk) + frames = capture_frames(io, &blk) assert_equal(1, frames.size, "Supplied block sent no frames or more than 1 frame") frames.first end -- cgit v1.2.3