From dc870b7b2e8da6f96c3e5141d0341d5a29ca38f4 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Tue, 3 Nov 2015 22:26:33 +0900 Subject: http{s,}_server_connection: remove #run --- test/plum/client/test_client.rb | 5 ++++- test/plum/server/test_https_connection.rb | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/plum/client/test_client.rb b/test/plum/client/test_client.rb index c169286..32f9728 100644 --- a/test/plum/client/test_client.rb +++ b/test/plum/client/test_client.rb @@ -66,7 +66,10 @@ class ClientTest < Minitest::Test } yield plum if block_given? - plum.run + + while !sock.closed? && !sock.eof? + plum << sock.readpartial(1024) + end } rescue OpenSSL::SSL::SSLError rescue Timeout::Error diff --git a/test/plum/server/test_https_connection.rb b/test/plum/server/test_https_connection.rb index 5251e20..b93d1b1 100644 --- a/test/plum/server/test_https_connection.rb +++ b/test/plum/server/test_https_connection.rb @@ -40,8 +40,8 @@ class HTTPSConnectionNegotiationTest < Minitest::Test ctx = OpenSSL::SSL::SSLContext.new ctx.alpn_select_cb = -> protocols { "h2" } - ctx.cert = OpenSSL::X509::Certificate.new File.read(File.expand_path("../../../server.crt", __FILE__)) - ctx.key = OpenSSL::PKey::RSA.new File.read(File.expand_path("../../../server.key", __FILE__)) + ctx.cert = TLS_CERT + ctx.key = TLS_KEY tcp_server = TCPServer.new("127.0.0.1", LISTEN_PORT) ssl_server = OpenSSL::SSL::SSLServer.new(tcp_server, ctx) @@ -52,7 +52,9 @@ class HTTPSConnectionNegotiationTest < Minitest::Test plum = HTTPSServerConnection.new(sock) assert_connection_error(:inadequate_security) { run = true - plum.run + while !sock.closed? && !sock.eof? + plum << sock.readpartial(1024) + end } } rescue Timeout::Error -- cgit v1.2.3