1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
# frozen_string_literal: true
# Released under the MIT License.
# Copyright, 2018-2023, by Samuel Williams.
require 'async/rspec/ssl'
RSpec.describe Async::RSpec::SSL do
context Async::RSpec::SSL::CertificateAuthority do
include_context Async::RSpec::SSL::CertificateAuthority
it "has a valid certificate authority" do
expect(certificate_authority.verify(certificate_authority_key)).to be_truthy
end
end
context Async::RSpec::SSL::ValidCertificate do
include_context Async::RSpec::SSL::ValidCertificate
it "can validate client certificate" do
expect(certificate_store.verify(certificate)).to be_truthy
end
end
context Async::RSpec::SSL::InvalidCertificate do
include_context Async::RSpec::SSL::InvalidCertificate
it "fails to validate certificate" do
expect(certificate_store.verify(certificate)).to be_falsey
end
end
end
|