diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-03 22:26:33 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2015-11-03 22:26:33 +0900 |
commit | dc870b7b2e8da6f96c3e5141d0341d5a29ca38f4 (patch) | |
tree | f9d2516c38ac791353c4502443d786c4f94e5ab6 /test | |
parent | e910b2e92536ead6adebb4f338abfa3da058550b (diff) | |
download | plum-dc870b7b2e8da6f96c3e5141d0341d5a29ca38f4.tar.gz |
http{s,}_server_connection: remove #run
Diffstat (limited to 'test')
-rw-r--r-- | test/plum/client/test_client.rb | 5 | ||||
-rw-r--r-- | test/plum/server/test_https_connection.rb | 8 |
2 files changed, 9 insertions, 4 deletions
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 |