- expect { Puppet::Type.type(:apt_key).new(
- :id => 'EF8D349F',
- :source => 'http://apt.puppetlabs.com/pubkey.gpg',
- :content => 'Completely invalid as a GPG key'
- )}.to raise_error(/content and source are mutually exclusive/)
+ expect {
+ Puppet::Type.type(:apt_key).new(id: 'EF8D349F',
+ source: 'http://apt.puppetlabs.com/pubkey.gpg',
+ content: 'Completely invalid as a GPG key')
+ }.to raise_error(%r{content and source are mutually exclusive})
+ end
+
+ it 'raises an error if refresh => true and ensure => absent' do
+ expect {
+ Puppet::Type.type(:apt_key).new(id: 'EF8D349F',
+ source: 'http://apt.puppetlabs.com/pubkey.gpg',
+ ensure: :absent,
+ refresh: :true)
+ }.to raise_error(%r{ensure => absent and refresh => true are mutually exclusive})