summaryrefslogtreecommitdiff
path: root/test/openssl
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-31 08:18:12 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-31 08:18:12 +0000
commit021aaa70d6c9e10f62dacba0a9a54ef6723ea170 (patch)
tree14fb4187a8a517976316949b707d5bef651f3d94 /test/openssl
parent67d66b2652a955c8dfcf2377f2842e1c413e0939 (diff)
* ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): show openssl error
code in EWOULDBLOCK error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl')
-rw-r--r--test/openssl/test_pair.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 66d8ebc83f..ea8fc773cb 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -146,7 +146,15 @@ class OpenSSL::TestPair < Test::Unit::TestCase
def test_read_nonblock
ssl_pair {|s1, s2|
- assert_raise(Errno::EWOULDBLOCK) { s2.read_nonblock(10) }
+ err = nil
+ assert_raise(Errno::EWOULDBLOCK) {
+ begin
+ s2.read_nonblock(10)
+ ensure
+ err = $!
+ end
+ }
+ assert_match(/SSL_ERROR_WANT_READ/, err.message)
s1.write "abc\ndef\n"
assert_equal("ab", s2.read_nonblock(2))
assert_equal("c\n", s2.gets)