mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
7a4aea47e2
commit
aefb79c24f
2 changed files with 16 additions and 2 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Sun Jun 12 13:47:42 2016 Kazuki Yamaguchi <k@rhe.jp>
|
||||||
|
|
||||||
|
* 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]
|
||||||
|
|
||||||
Sun Jun 12 09:24:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Jun 12 09:24:34 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* file.c (append_fspath): normalize directory name to be appended
|
* file.c (append_fspath): normalize directory name to be appended
|
||||||
|
|
|
@ -13,17 +13,21 @@ class OpenSSL::TestEngine < OpenSSL::TestCase
|
||||||
|
|
||||||
def test_openssl_engine_builtin
|
def test_openssl_engine_builtin
|
||||||
with_openssl <<-'end;'
|
with_openssl <<-'end;'
|
||||||
|
orig = OpenSSL::Engine.engines
|
||||||
|
skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
|
||||||
engine = OpenSSL::Engine.load("openssl")
|
engine = OpenSSL::Engine.load("openssl")
|
||||||
assert_equal(true, engine)
|
assert_equal(true, engine)
|
||||||
assert_equal(1, OpenSSL::Engine.engines.size)
|
assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_openssl_engine_by_id_string
|
def test_openssl_engine_by_id_string
|
||||||
with_openssl <<-'end;'
|
with_openssl <<-'end;'
|
||||||
|
orig = OpenSSL::Engine.engines
|
||||||
|
skip "'openssl' is already loaded" if orig.any? { |e| e.id == "openssl" }
|
||||||
engine = get_engine
|
engine = get_engine
|
||||||
assert_not_nil(engine)
|
assert_not_nil(engine)
|
||||||
assert_equal(1, OpenSSL::Engine.engines.size)
|
assert_equal(1, OpenSSL::Engine.engines.size - orig.size)
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue