summaryrefslogtreecommitdiff
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
commit8cc42bc701c55a12f8659e9a5e6381cbce26507d (patch)
tree67e11e8142d7c1d61a3dd3239daa2ad1bae989f1 /test/openssl
parent8ff550534ec5e28b6523ea9878b391f805a985ca (diff)
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
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 17713c9..66d8ebc 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