diff options
author | Ben Toews <mastahyeti@gmail.com> | 2018-07-06 10:00:07 -0600 |
---|---|---|
committer | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2019-10-01 11:25:06 +1300 |
commit | fe642e702bf460e04f22c870e21a0810fffcb442 (patch) | |
tree | eedbf909902614d2e31a9505ce0d465c57299013 /test | |
parent | 8ed5a079a446bfc60a9a6929e877bb4ac55808b8 (diff) | |
download | ruby-openssl-fe642e702bf460e04f22c870e21a0810fffcb442.tar.gz |
ts: fix windows build
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_ts.rb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/test/test_ts.rb b/test/test_ts.rb index 38898f47..3b8e8311 100755 --- a/test/test_ts.rb +++ b/test/test_ts.rb @@ -342,17 +342,13 @@ _end_of_pem_ end def test_verify_ee_root_from_file - begin - ts, req = timestamp_ee - File.open('root_ca', 'wb') do |file| - file.print(ca_cert.to_pem) - end - ts.verify(req, File.open('root_ca', 'rb'), intermediate_cert) - ensure - if File.exists?('root_ca') - File.delete('root_ca') - end - end + file = Tempfile.new('root_ca', Dir.tmpdir, :mode => File::BINARY) + ts, req = timestamp_ee + file.print(ca_cert.to_pem) + file.close + ts.verify(req, File.open(file.path, 'rb'), intermediate_cert) + ensure + file.unlink end def test_verify_ee_def_policy |