aboutsummaryrefslogtreecommitdiffstats
path: root/test/openssl/test_pkey_dh.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/openssl/test_pkey_dh.rb')
-rw-r--r--test/openssl/test_pkey_dh.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/openssl/test_pkey_dh.rb b/test/openssl/test_pkey_dh.rb
index bcba400efe..79a3e0a92c 100644
--- a/test/openssl/test_pkey_dh.rb
+++ b/test/openssl/test_pkey_dh.rb
@@ -8,6 +8,13 @@ class OpenSSL::TestPKeyDH < Test::Unit::TestCase
assert_key(dh)
end
+ def test_new_break
+ assert_nil(OpenSSL::PKey::DH.new(256) { break })
+ assert_raises(RuntimeError) do
+ OpenSSL::PKey::DH.new(256) { raise }
+ end
+ end
+
def test_to_der
dh = OpenSSL::PKey::DH.new(256)
der = dh.to_der