mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Add some tests around Windows::RootCerts.
This commit is contained in:
parent
e06d044d42
commit
5835159573
1 changed files with 22 additions and 0 deletions
22
spec/unit/windows/root_certs_spec.rb
Normal file
22
spec/unit/windows/root_certs_spec.rb
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'RestClient::Windows::RootCerts',
|
||||||
|
:if => RestClient::Windows.windows? do
|
||||||
|
let(:x509_store) { RestClient::Windows::RootCerts.instance.to_a }
|
||||||
|
|
||||||
|
it 'should return at least one X509 certificate' do
|
||||||
|
expect(x509_store.to_a).to have_at_least(1).items
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should return an X509 certificate with a subject' do
|
||||||
|
x509 = x509_store.first
|
||||||
|
|
||||||
|
expect(x509.subject.to_s).to match(/CN=.*/)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should return X509 certificate objects' do
|
||||||
|
x509_store.each do |cert|
|
||||||
|
cert.should be_a(OpenSSL::X509::Certificate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue