diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-03-31 15:06:25 +1300 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-03-31 15:06:25 +1300 |
commit | 95aa0ce9e9c1b95f8c92bb7963485ab2b0329ef0 (patch) | |
tree | 674aebccf9885879dd0b1a216bcb2e45e3a216a5 /test/test_ssl.rb | |
parent | 18ec883d6daaedbf32c66ca4ae6e41b66d0eeca4 (diff) | |
download | ruby-openssl-95aa0ce9e9c1b95f8c92bb7963485ab2b0329ef0.tar.gz |
Add `SSLSocket#fileno` and `SSLServer#fileno`. Fixes #198.
Diffstat (limited to 'test/test_ssl.rb')
-rw-r--r-- | test/test_ssl.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_ssl.rb b/test/test_ssl.rb index b8016677..02841ce0 100644 --- a/test/test_ssl.rb +++ b/test/test_ssl.rb @@ -1544,6 +1544,20 @@ end } end + def test_fileno + ctx = OpenSSL::SSL::SSLContext.new + sock1, sock2 = socketpair + + socket = OpenSSL::SSL::SSLSocket.new(sock1) + server = OpenSSL::SSL::SSLServer.new(sock2, ctx) + + assert_equal socket.fileno, socket.to_io.fileno + assert_equal server.fileno, server.to_io.fileno + ensure + sock1.close + sock2.close + end + private def start_server_version(version, ctx_proc = nil, |