Sha256: 7d63e4c377b446949b3adedc9f066c46a5a90b945b8b0478f921ab8246743482

Contents?: true

Size: 635 Bytes

Versions: 1

Compression:

Stored size: 635 Bytes

Contents

require 'spec_helper'

describe Blather::CertStore do
  let(:cert_dir)  { File.expand_path '../../fixtures', File.dirname(__FILE__) }
  let(:cert_path) { File.join cert_dir, 'certificate.crt' }
  let(:cert)      { File.read cert_path }

  subject do
    Blather::CertStore.new cert_dir
  end

  it 'can verify valid cert' do
    expect(subject.trusted?(cert)).to be true
  end

  it 'can verify invalid cert' do
    expect(subject.trusted?('foo bar baz')).to be_nil
  end

  it 'cannot verify when the cert authority is not trusted' do
    @store = Blather::CertStore.new("../")
    expect(@store.trusted?(cert)).to be false
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blather-2.0.0 spec/blather/stream/ssl_spec.rb