summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-11 01:25:25 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-12-11 01:25:25 +0000
commite1e671d60dd5015993220b64593e0ee3f87addae (patch)
tree41bc69c8ce20c5bd322ba3efe8f3d717b3fb5b83 /test
parent864f60b8375eb0446ea1184f314d3bcac6fb7b87 (diff)
refactor load error rescue to the openssl util file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/openssl/test_asn1.rb7
-rw-r--r--test/openssl/test_bn.rb6
-rw-r--r--test/openssl/test_cipher.rb6
-rw-r--r--test/openssl/test_pair.rb6
-rw-r--r--test/openssl/utils.rb7
5 files changed, 9 insertions, 23 deletions
diff --git a/test/openssl/test_asn1.rb b/test/openssl/test_asn1.rb
index 9486e09a13..f88d6d3fcb 100644
--- a/test/openssl/test_asn1.rb
+++ b/test/openssl/test_asn1.rb
@@ -1,9 +1,4 @@
-begin
- require "openssl"
- require_relative 'utils'
-rescue LoadError
-end
-require 'test/unit'
+require_relative 'utils'
class OpenSSL::TestASN1 < Test::Unit::TestCase
def test_decode
diff --git a/test/openssl/test_bn.rb b/test/openssl/test_bn.rb
index d913d0c953..98348d6078 100644
--- a/test/openssl/test_bn.rb
+++ b/test/openssl/test_bn.rb
@@ -1,9 +1,5 @@
-begin
- require "openssl"
-rescue LoadError
-end
+require_relative 'utils'
require "digest/md5"
-require "test/unit"
if defined?(OpenSSL)
diff --git a/test/openssl/test_cipher.rb b/test/openssl/test_cipher.rb
index cc21e818ed..5cf41879bd 100644
--- a/test/openssl/test_cipher.rb
+++ b/test/openssl/test_cipher.rb
@@ -1,8 +1,4 @@
-begin
- require "openssl"
-rescue LoadError
-end
-require "test/unit"
+require_relative 'utils'
if defined?(OpenSSL)
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb
index 2d761385c5..d31781f6e7 100644
--- a/test/openssl/test_pair.rb
+++ b/test/openssl/test_pair.rb
@@ -1,8 +1,4 @@
-begin
- require "openssl"
-rescue LoadError
-end
-require 'test/unit'
+require_relative 'utils'
if defined?(OpenSSL)
diff --git a/test/openssl/utils.rb b/test/openssl/utils.rb
index c116bf9e3e..92c6c5596e 100644
--- a/test/openssl/utils.rb
+++ b/test/openssl/utils.rb
@@ -1,4 +1,7 @@
-require "openssl"
+begin
+ require "openssl"
+rescue LoadError
+end
require "test/unit"
module OpenSSL::TestUtils
@@ -141,4 +144,4 @@ Q1VB8qkJN7rA7/2HrCR3gTsWNb1YhAsnFsoeRscC+LxXoXi9OAIUBG98h4tilg6S
$VERBOSE = back
end
end
-end
+end if defined?(OpenSSL)