aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorrhe <rhe@ruby-lang.org>2016-06-12 04:48:10 +0000
committerKazuki Yamaguchi <k@rhe.jp>2016-06-19 23:25:32 +0900
commitec0a2b830edd59b799d9fdda41f36cc8f014dafc (patch)
treed5e1129a6d95941d2509f88e277dd228e0936745 /test
parent97a11542d849101a0f8a7298dfcedb0a3a9189c3 (diff)
downloadruby-openssl-ec0a2b830edd59b799d9fdda41f36cc8f014dafc.tar.gz
openssl: avoid test failure in test_engine.rb
* test/openssl/test_engine.rb (test_openssl_engine_builtin, test_openssl_engine_by_id_string): Skip test if 'openssl' engine is already loaded. And test the number increased by Engine.load{_by_id,}, not the total count of loaded engines. Previously, we called OpenSSL::Engine.cleanup every time running a test case, but we no longer can do it. [ruby-core:75225] [Feature #12324] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/test_engine.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/test_engine.rb b/test/test_engine.rb
index 77f6e1a9..bbf56a18 100644
--- a/test/test_engine.rb
+++ b/test/test_engine.rb
@@ -13,17 +13,21 @@ class OpenSSL::TestEngine < OpenSSL::TestCase
def test_openssl_engine_builtin
with_openssl <<-'end;'
+ orig = OpenSSL::Engine.engines
+ skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
engine = OpenSSL::Engine.load("openssl")
assert_equal(true, engine)
- assert_equal(1, OpenSSL::Engine.engines.size)
+ assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
end;
end
def test_openssl_engine_by_id_string
with_openssl <<-'end;'
+ orig = OpenSSL::Engine.engines
+ skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
engine = get_engine
assert_not_nil(engine)
- assert_equal(1, OpenSSL::Engine.engines.size)
+ assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
end;
end