Code Review
/
puppet-modules
/
puppetlabs-apt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
(MODULES-1156, MODULES-769) Remove unnecessary anchors
[puppet-modules/puppetlabs-apt.git]
/
spec
/
defines
/
key_spec.rb
diff --git
a/spec/defines/key_spec.rb
b/spec/defines/key_spec.rb
index 3d82df0e4ff4ca33bca36b83a8ddb84fb31f2b6c..b9bcea845a7916e67dabd750ba1658b76eb9743b 100644
(file)
--- a/
spec/defines/key_spec.rb
+++ b/
spec/defines/key_spec.rb
@@
-1,7
+1,12
@@
require 'spec_helper'
describe 'apt::key' do
require 'spec_helper'
describe 'apt::key' do
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian' } }
+ let :pre_condition do
+ 'class { "apt": }'
+ end
+
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
+
GPG_KEY_ID = '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
let :title do
GPG_KEY_ID = '47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30'
let :title do
@@
-15,7
+20,7
@@
describe 'apt::key' do
:id => title,
:ensure => 'present',
:source => nil,
:id => title,
:ensure => 'present',
:source => nil,
- :server =>
nil
,
+ :server =>
'keyserver.ubuntu.com'
,
:content => nil,
:options => nil,
})
:content => nil,
:options => nil,
})
@@
-31,7
+36,7
@@
describe 'apt::key' do
end
let :params do {
end
let :params do {
- :
key
=> GPG_KEY_ID,
+ :
id
=> GPG_KEY_ID,
} end
it 'contains the apt_key' do
} end
it 'contains the apt_key' do
@@
-39,7
+44,7
@@
describe 'apt::key' do
:id => GPG_KEY_ID,
:ensure => 'present',
:source => nil,
:id => GPG_KEY_ID,
:ensure => 'present',
:source => nil,
- :server =>
nil
,
+ :server =>
'keyserver.ubuntu.com'
,
:content => nil,
:options => nil,
})
:content => nil,
:options => nil,
})
@@
-59,7
+64,7
@@
describe 'apt::key' do
:id => title,
:ensure => 'absent',
:source => nil,
:id => title,
:ensure => 'absent',
:source => nil,
- :server =>
nil
,
+ :server =>
'keyserver.ubuntu.com'
,
:content => nil,
:keyserver => nil,
})
:content => nil,
:keyserver => nil,
})
@@
-276,16
+281,17
@@
describe 'apt::key' do
describe 'duplication' do
context 'two apt::key resources for same key, different titles' do
let :pre_condition do
describe 'duplication' do
context 'two apt::key resources for same key, different titles' do
let :pre_condition do
- "apt::key { 'duplicate': key => '#{title}', }"
+ "class { 'apt': }
+ apt::key { 'duplicate': id => '#{title}', }"
end
it 'contains two apt::key resources' do
is_expected.to contain_apt__key('duplicate').with({
end
it 'contains two apt::key resources' do
is_expected.to contain_apt__key('duplicate').with({
- :
key
=> title,
+ :
id
=> title,
:ensure => 'present',
})
is_expected.to contain_apt__key(title).with({
:ensure => 'present',
})
is_expected.to contain_apt__key(title).with({
- :
key
=> title,
+ :
id
=> title,
:ensure => 'present',
})
end
:ensure => 'present',
})
end
@@
-295,7
+301,7
@@
describe 'apt::key' do
:id => title,
:ensure => 'present',
:source => nil,
:id => title,
:ensure => 'present',
:source => nil,
- :server =>
nil
,
+ :server =>
'keyserver.ubuntu.com'
,
:content => nil,
:options => nil,
})
:content => nil,
:options => nil,
})
@@
-305,7
+311,8
@@
describe 'apt::key' do
context 'two apt::key resources, different ensure' do
let :pre_condition do
context 'two apt::key resources, different ensure' do
let :pre_condition do
- "apt::key { 'duplicate': key => '#{title}', ensure => 'absent', }"
+ "class { 'apt': }
+ apt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
end
it 'informs the user of the impossibility' do
expect { subject }.to raise_error(/already ensured as absent/)
end
it 'informs the user of the impossibility' do
expect { subject }.to raise_error(/already ensured as absent/)