Skip to content

Commit

Permalink
(maint) clean up key)compat_specs
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidS committed Apr 7, 2016
1 parent c489912 commit 926a371
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions spec/defines/key_compat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@

describe 'normal operation' do
describe 'default options' do
it 'contains the apt_key' do
should contain_apt_key(title).with({
it {
is_expected.to contain_apt_key(title).with({
:id => title,
:ensure => 'present',
:source => nil,
:server => 'keyserver.ubuntu.com',
:content => nil,
:keyserver_options => nil,
})
end
}
it 'contains the apt_key present anchor' do
should contain_anchor("apt_key #{title} present")
is_expected.to contain_anchor("apt_key #{title} present")
end
end

Expand All @@ -42,7 +42,7 @@
} end

it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => GPG_KEY_ID,
:ensure => 'present',
:source => nil,
Expand All @@ -52,7 +52,7 @@
})
end
it 'contains the apt_key present anchor' do
should contain_anchor("apt_key #{GPG_KEY_ID} present")
is_expected.to contain_anchor("apt_key #{GPG_KEY_ID} present")
end
end

Expand All @@ -62,7 +62,7 @@
} end

it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => title,
:ensure => 'absent',
:source => nil,
Expand All @@ -72,7 +72,7 @@
})
end
it 'contains the apt_key absent anchor' do
should contain_anchor("apt_key #{title} absent")
is_expected.to contain_anchor("apt_key #{title} absent")
end
end

Expand All @@ -85,7 +85,7 @@
} end

it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => title,
:ensure => 'present',
:source => 'http://apt.puppetlabs.com/pubkey.gpg',
Expand All @@ -95,7 +95,7 @@
})
end
it 'contains the apt_key present anchor' do
should contain_anchor("apt_key #{title} present")
is_expected.to contain_anchor("apt_key #{title} present")
end
end

Expand All @@ -104,7 +104,7 @@
:key_server => 'p-gp.m-it.edu',
} end
it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => title,
:server => 'p-gp.m-it.edu',
})
Expand All @@ -118,7 +118,7 @@
}
end
it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => title,
:server => 'hkp://pgp.mit.edu',
})
Expand All @@ -131,7 +131,7 @@
}
end
it 'contains the apt_key' do
should contain_apt_key(title).with({
is_expected.to contain_apt_key(title).with({
:id => title,
:server => 'hkp://pgp.mit.edu:80',
})
Expand Down Expand Up @@ -286,27 +286,33 @@
"#{super()}\napt::key { 'duplicate': key => '#{title}', }"
end

it 'contains two apt::key resources' do
should contain_apt__key('duplicate').with({
it 'contains the duplicate apt::key resource' do
is_expected.to contain_apt__key('duplicate').with({
:key => title,
:ensure => 'present',
})
should contain_apt__key(title).with({
end

it 'contains the original apt::key resource' do
is_expected.to contain_apt__key(title).with({
:id => title,
:ensure => 'present',
})
end

it 'contains only a single apt_key' do
should contain_apt_key('duplicate').with({
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,
})
should_not contain_apt_key(title)
end

it 'does not contain the original apt_key' do
is_expected.not_to contain_apt_key(title)
end
end

Expand Down

0 comments on commit 926a371

Please sign in to comment.