Sha256: 594ed08af023332fa728d79f6fd5aa8ca00748bf5f132fa00b18c5c98aa40f49

Contents?: true

Size: 823 Bytes

Versions: 2

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

module SSLCheck
  describe 'CABundleValidatorSpec' do
    before do
      @cert = Certificate.new(VALID_CERT)
      @ca_bundle = [Certificate.new(CA_PARENT), Certificate.new(CA_GRAND_PARENT)]
    end
    context "when the CA Bundle verifies the certificate" do
      it 'should return nothing' do
        sut = Validators::CABundle.new("letsencrypt.org", @cert, @ca_bundle)
        result = sut.validate
        expect(result).to_not be
      end
    end
    context "when the certificate cannot be verified by the CA Bundle" do
      it 'should return errors' do
        sut = Validators::CABundle.new("letsencrypt.org", @cert, [Certificate.new(VALID_CERT)])
        result = sut.validate
        expect(result).to be_a SSLCheck::Errors::Validation::CABundleVerification
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sslcheck-0.9.9.1 spec/ca_bundle_validator_spec.rb
sslcheck-0.9.9 spec/ca_bundle_validator_spec.rb