File: root_certs_spec.rb

package info (click to toggle)
ruby-rest-client 2.1.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 860 kB
  • sloc: ruby: 3,844; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 589 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require_relative '../_lib'

describe 'RestClient::Windows::RootCerts',
         :if => RestClient::Platform.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.size).to be >= 1
  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|
      expect(cert).to be_a(OpenSSL::X509::Certificate)
    end
  end
end