Sha256: b7226b490445a2d9e9b12d4069d1ccd5563e523eb635400c4be60692fa926edb

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

# frozen_string_literal: true

require 'push_kit/apns'

RSpec.describe PushKit::APNS do
  subject { described_class }

  describe '.load_key' do
    context 'when the file does not exist' do
      let(:path) { '/path/to/key' }

      before do
        expect(File).to receive(:file?).with(path).and_return(false)
      end

      it 'raises an ArgumentError' do
        expect { subject.load_key(path) }.to raise_exception(ArgumentError)
      end
    end
  end

  describe '.clients' do
    it 'returns a Hash' do
      expect(subject.clients).to be_a(Hash)
    end
  end

  describe '.prepare' do
    it 'stores the client in #clients' do
      expect(subject).to receive(:client).and_return(:a_client_object)
      subject.prepare(:default)
      expect(subject.clients).to include(default: :a_client_object)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
push_kit-apns-1.0.0.pre.beta5 spec/push_kit/apns_spec.rb
push_kit-apns-1.0.0.pre.beta4 spec/push_kit/apns_spec.rb
push_kit-apns-1.0.0.pre.beta3 spec/push_kit/apns_spec.rb
push_kit-apns-1.0.0.pre.beta2 spec/push_kit/apns_spec.rb