describe Puppet::Type::type(:apt_key) do
context 'only namevar 32bit key id' do
let(:resource) { Puppet::Type.type(:apt_key).new(
describe Puppet::Type::type(:apt_key) do
context 'only namevar 32bit key id' do
let(:resource) { Puppet::Type.type(:apt_key).new(
:source => 'http://apt.puppetlabs.com/pubkey.gpg',
:content => 'Completely invalid as a GPG key'
)}.to raise_error(/content and source are mutually exclusive/)
:source => 'http://apt.puppetlabs.com/pubkey.gpg',
:content => 'Completely invalid as a GPG key'
)}.to raise_error(/content and source are mutually exclusive/)
:source => 'http://apt.puppetlabs.com/pubkey.gpg',
:content => 'Completely invalid as a GPG key'
)}.to raise_error(/Valid values match/)
:source => 'http://apt.puppetlabs.com/pubkey.gpg',
:content => 'Completely invalid as a GPG key'
)}.to raise_error(/Valid values match/)
it 'raises an error when an invalid URI scheme is used in source' do
expect { Puppet::Type.type(:apt_key).new(
it 'raises an error when an invalid URI scheme is used in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'hkp://pgp.mit.edu'
)}.to raise_error(/Valid values match/)
end
it 'allows the http URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'hkp://pgp.mit.edu'
)}.to raise_error(/Valid values match/)
end
it 'allows the http URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'https://pgp.mit.edu'
)}.to_not raise_error
end
it 'allows the https URI with username and password' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'https://pgp.mit.edu'
)}.to_not raise_error
end
it 'allows the https URI with username and password' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'https://testme:Password2@pgp.mit.edu'
)}.to_not raise_error
end
it 'allows the ftp URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'https://testme:Password2@pgp.mit.edu'
)}.to_not raise_error
end
it 'allows the ftp URI scheme in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'ftp://pgp.mit.edu'
)}.to_not raise_error
end
it 'allows an absolute path in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'ftp://pgp.mit.edu'
)}.to_not raise_error
end
it 'allows an absolute path in source' do
expect { Puppet::Type.type(:apt_key).new(
:source => '/path/to/a/file'
)}.to_not raise_error
end
it 'allows 5-digit ports' do
expect { Puppet::Type.type(:apt_key).new(
:source => '/path/to/a/file'
)}.to_not raise_error
end
it 'allows 5-digit ports' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'http://pgp.mit.edu:12345/key'
)}.to_not raise_error
end
it 'allows 5-digit ports when using key servers' do
expect { Puppet::Type.type(:apt_key).new(
:source => 'http://pgp.mit.edu:12345/key'
)}.to_not raise_error
end
it 'allows 5-digit ports when using key servers' do
expect { Puppet::Type.type(:apt_key).new(