diff options
Diffstat (limited to 'test/utils/client.rb')
-rw-r--r-- | test/utils/client.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/utils/client.rb b/test/utils/client.rb new file mode 100644 index 0000000..be8d78d --- /dev/null +++ b/test/utils/client.rb @@ -0,0 +1,19 @@ +require "timeout" + +module ServerUtils + def open_client_connection(scheme = :https) + io = StringIO.new + @_ccon = ClientConnection.new(io.method(:write)) + @_ccon << Frame.new(type: :settings, stream_id: 0, flags: [:ack]).assemble + @_ccon << Frame.new(type: :settings, stream_id: 0).assemble + if block_given? + yield @_ccon + else + @_ccon + end + end +end + +class Minitest::Test + include ServerUtils +end |