Sha256: be01b2df13a8e6e8a4558214641e387f9cc93629b652b40a9a0db850d33e4919

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'
require 'keyring_liberator'
require 'tmpdir'
require 'keyring'

include CocoaPodsKeys

describe KeyringLiberator do
  it 'should get the keys directory' do
    expect(KeyringLiberator.keys_dir.to_s).to end_with('cocoapods/keys')
  end

  it 'should append a sha + .yaml when getting the yaml path' do
    expect(KeyringLiberator.yaml_path_for_path('test').to_s).to include('cocoapods/keys/')
    expect(KeyringLiberator.yaml_path_for_path('test').to_s).to end_with('098f6bcd4621d373cade4e832627b4f6.yml')
  end

  it 'should find by name' do
    keyring = Keyring.from_hash('name' => 'test', 'path' => 'testpath', 'keys' => [])
    allow(KeyringLiberator).to receive(:get_all_keyrings).and_return([keyring])
    expect(KeyringLiberator.get_keyring_named('test')).to equal(keyring)
  end

  it 'should be nil if nothing found find by name' do
    keyring = Keyring.from_hash('name' => 'test', 'path' => 'testpath', 'keys' => [])
    allow(KeyringLiberator).to receive(:get_all_keyrings).and_return([keyring])
    expect(KeyringLiberator.get_keyring_named('not found')).to be_falsey
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cocoapods-keys-1.4.0 spec/keyring_liberator_spec.rb
cocoapods-keys-1.3.2 spec/keyring_liberator_spec.rb
cocoapods-keys-1.3.1 spec/keyring_liberator_spec.rb
cocoapods-keys-1.3.0 spec/keyring_liberator_spec.rb