X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=spec%2Funit%2Fpuppet%2Fprovider%2Fapt_key_spec.rb;h=b89581701410e359c358dc4b0cba956c7a343f12;hb=ef0d4e7337a535a25d76b73aebf6bfdda975f533;hp=a514793bae96a01cf1e2beef0b500f7e7727a926;hpb=37a99219cacd13c4d7a2fb98bfb24363d00eabca;p=puppet-modules%2Fpuppetlabs-apt.git diff --git a/spec/unit/puppet/provider/apt_key_spec.rb b/spec/unit/puppet/provider/apt_key_spec.rb index a514793..b895817 100644 --- a/spec/unit/puppet/provider/apt_key_spec.rb +++ b/spec/unit/puppet/provider/apt_key_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe Puppet::Type.type(:apt_key).provider(:apt_key) do @@ -15,6 +17,7 @@ describe Puppet::Type.type(:apt_key).provider(:apt_key) do context 'self.instances no key' do before :each do + # Unable to remove `master` from below terminology as it relies on outside code allow(described_class).to receive(:apt_key).with( ['adv', '--no-tty', '--list-keys', '--with-colons', '--fingerprint', '--fixed-list-mode'], ).and_return('uid:-::::1284991450::07BEBE04F4AE4A8E885A761325717D8509D9C1DC::Ubuntu Extras Archive Automatic Signing Key ::::::::::0:') @@ -113,6 +116,21 @@ OUTPUT expect(provider).to be_exist end + it 'apt_key with source and weak ssl verify set' do + expect(described_class).to receive(:apt_key).with(array_including('add', kind_of(String))) + resource = Puppet::Type::Apt_key.new(name: 'gsd', + id: 'C105B9DE', + source: 'https://bla/herpderp.gpg', + ensure: 'present', + weak_ssl: true) + + provider = described_class.new(resource) + expect(provider).not_to be_exist + expect(provider).to receive(:source_to_file).and_return(Tempfile.new('foo')) + provider.create + expect(provider).to be_exist + end + describe 'different valid id keys' do hash_of_keys = { '32bit key id' => 'EF8D349F',