From 8cc42bc701c55a12f8659e9a5e6381cbce26507d Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 28 Dec 2008 16:09:59 +0000 Subject: add a test for OpenSSL::SSL::SSLSocket#read_nonblock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/openssl/test_pair.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/openssl/test_pair.rb') diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb index 17713c9988..66d8ebc83f 100644 --- a/test/openssl/test_pair.rb +++ b/test/openssl/test_pair.rb @@ -144,6 +144,18 @@ class OpenSSL::TestPair < Test::Unit::TestCase } end + def test_read_nonblock + ssl_pair {|s1, s2| + assert_raise(Errno::EWOULDBLOCK) { s2.read_nonblock(10) } + s1.write "abc\ndef\n" + assert_equal("ab", s2.read_nonblock(2)) + assert_equal("c\n", s2.gets) + ret = nil + assert_nothing_raised("[ruby-core:20298]") { ret = s2.read_nonblock(10) } + assert_equal("def\n", ret) + } + end + end end -- cgit v1.2.3