Sha256: 3d362e39ada4c56d553050415bd253883475af16f423cb4a7451b49a4382f425

Contents?: true

Size: 634 Bytes

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
blather-1.0.0 spec/blather/stream/ssl_spec.rb
blather-0.8.8 spec/blather/stream/ssl_spec.rb
blather-0.8.7 spec/blather/stream/ssl_spec.rb
blather-0.8.6 spec/blather/stream/ssl_spec.rb
blather-0.8.5 spec/blather/stream/ssl_spec.rb
blather-0.8.4 spec/blather/stream/ssl_spec.rb
blather-0.8.3 spec/blather/stream/ssl_spec.rb
blather-0.8.2 spec/blather/stream/ssl_spec.rb