diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-11 14:16:47 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-11 14:16:47 +0900 |
commit | 3466b54b14cc2d4ce3d1db6af1bc282678bab443 (patch) | |
tree | c06525218b657b975849145baf0b5a8f2c0eeb69 /test/utils | |
parent | d2ff97498001cc672bdf00f35e3bcb29465aeddd (diff) | |
download | plum-3466b54b14cc2d4ce3d1db6af1bc282678bab443.tar.gz |
connection: split large frame in #send_immediately
Diffstat (limited to 'test/utils')
-rw-r--r-- | test/utils/server.rb | 7 |
1 files changed, 3 insertions, 4 deletions
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 |