Sha256: 2fc4aa209c4a795d7758aa2aa779ae6935923ba317b4443d5000d271a172636b

Contents?: true

Size: 634 Bytes

Versions: 6

Compression:

Stored size: 634 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
    subject.trusted?(cert).should be true
  end

  it 'can verify invalid cert' do
    subject.trusted?(cert[0..(cert.length/2)]).should be_nil
  end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
blather-1.2.0 spec/blather/stream/ssl_spec.rb
blather-1.1.4 spec/blather/stream/ssl_spec.rb
blather-1.1.3 spec/blather/stream/ssl_spec.rb
blather-1.1.2 spec/blather/stream/ssl_spec.rb
blather-1.1.1 spec/blather/stream/ssl_spec.rb
blather-1.1.0 spec/blather/stream/ssl_spec.rb