- describe 'duplication' do
- context 'two apt::key resources for same key, different titles' do
- let :pre_condition do
- "#{super()}\napt::key { 'duplicate': id => '#{title}', }"
- end
-
- it 'contains the duplicate apt::key resource' do
- is_expected.to contain_apt__key('duplicate').with({
- :id => title,
- :ensure => 'present',
- })
- end
-
- it 'contains the original apt::key resource' do
- is_expected.to contain_apt__key(title).with({
- :id => title,
- :ensure => 'present',
- })
- end
-
- it 'contains the native apt_key' do
- is_expected.to contain_apt_key('duplicate').with({
- :id => title,
- :ensure => 'present',
- :source => nil,
- :server => 'keyserver.ubuntu.com',
- :content => nil,
- :keyserver_options => nil,
- })
- end
-
- it 'does not contain the original apt_key' do
- is_expected.not_to contain_apt_key(title)
- end
- end
-
- context 'two apt::key resources, different ensure' do
- let :pre_condition do
- "#{super()}\napt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
- end
- it 'informs the user of the impossibility' do
- expect { subject.call }.to raise_error(/already ensured as absent/)
- end
+ describe 'duplication - two apt::key resources, different ensure' do
+ let :pre_condition do
+ "#{super()}\napt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
+ end
+
+ it 'informs the user of the impossibility' do
+ is_expected.to raise_error(%r{already ensured as absent})