summaryrefslogtreecommitdiffstats
path: root/test/openssl
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 16:09:59 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-28 16:09:59 +0000
commit8d5666f059823c9ca76b62668cd037384a9ffbae (patch)
tree67e11e8142d7c1d61a3dd3239daa2ad1bae989f1 /test/openssl
parent2378af7cd2b881bf4d64f25e2509c384b75db7e4 (diff)
downloadruby-8d5666f059823c9ca76b62668cd037384a9ffbae.tar.gz
ruby-8d5666f059823c9ca76b62668cd037384a9ffbae.tar.xz
ruby-8d5666f059823c9ca76b62668cd037384a9ffbae.zip
add a test for OpenSSL::SSL::SSLSocket#read_nonblock.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_pair.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 17713c998..66d8ebc83 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