1
0
Fork 0
mirror of https://github.com/rest-client/rest-client.git synced 2022-11-09 13:49:40 -05:00
rest-client--rest-client/spec/unit/windows/root_certs_spec.rb
Andy Brody 4971d1a6e1 Convert specs to RSpec 2.99.2 syntax with Transpec
This conversion is done by Transpec 3.2.2 with the following command:
    transpec

* 317 conversions
    from: obj.should
      to: expect(obj).to

* 160 conversions
    from: obj.stub(:message)
      to: allow(obj).to receive(:message)

* 100 conversions
    from: obj.should_receive(:message)
      to: expect(obj).to receive(:message)

* 30 conversions
    from: lambda { }.should
      to: expect { }.to

* 22 conversions
    from: obj.should_not_receive(:message)
      to: expect(obj).not_to receive(:message)

* 4 conversions
    from: obj.should_not
      to: expect(obj).not_to

* 2 conversions
    from: == expected
      to: eq(expected)

* 1 conversion
    from: expect(collection).to have_at_least(n).items
      to: expect(collection.size).to be >= n

* 1 conversion
    from: obj.unstub(:message)
      to: allow(obj).to receive(:message).and_call_original

For more details: https://github.com/yujinakayama/transpec#supported-conversions
2016-06-05 19:52:16 -04:00

22 lines
589 B
Ruby

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