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
Merge pull request #624 from seffenberg-naspers/fix_apt_key_with_userinfo
[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 b9bcea845a7916e67dabd750ba1658b76eb9743b..1ebcfc7af0c655b2637e84f449b86190c062a39e 100644
(file)
--- a/
spec/defines/key_spec.rb
+++ b/
spec/defines/key_spec.rb
@@
-5,9
+5,9
@@
describe 'apt::key' do
'class { "apt": }'
end
'class { "apt": }'
end
- let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy' } }
+ let(:facts) { { :lsbdistid => 'Debian', :osfamily => 'Debian', :lsbdistcodename => 'wheezy'
, :puppetversion => Puppet.version,
} }
- GPG_KEY_ID = '
47B320EB4C7C375AA9DAE1A01054B7A24BD6EC30
'
+ GPG_KEY_ID = '
6F6B15509CF8E59E6E469F327F438280EF8D349F
'
let :title do
GPG_KEY_ID
let :title do
GPG_KEY_ID
@@
-143,7
+143,7
@@
describe 'apt::key' do
:server => '-pgp.mit.edu',
} end
it 'fails' do
:server => '-pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject
.call
} .to raise_error(/does not match/)
end
end
end
end
@@
-152,7
+152,7
@@
describe 'apt::key' do
:server => '.pgp.mit.edu',
} end
it 'fails' do
:server => '.pgp.mit.edu',
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject
.call
} .to raise_error(/does not match/)
end
end
end
end
@@
-161,7
+161,7
@@
describe 'apt::key' do
:server => "pgp.mit.edu.",
} end
it 'fails' do
:server => "pgp.mit.edu.",
} end
it 'fails' do
- expect { subject } .to raise_error(/does not match/)
+ expect { subject
.call
} .to raise_error(/does not match/)
end
end
context "exceed character url" do
end
end
context "exceed character url" do
@@
-171,7
+171,7
@@
describe 'apt::key' do
}
end
it 'fails' do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context "incorrect port number url" do
end
end
context "incorrect port number url" do
@@
-181,7
+181,7
@@
describe 'apt::key' do
}
end
it 'fails' do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context "incorrect protocol for url" do
end
end
context "incorrect protocol for url" do
@@
-191,7
+191,7
@@
describe 'apt::key' do
}
end
it 'fails' do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context "missing port number url" do
end
end
context "missing port number url" do
@@
-201,7
+201,7
@@
describe 'apt::key' do
}
end
it 'fails' do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context "url ending with a dot" do
end
end
context "url ending with a dot" do
@@
-211,7
+211,7
@@
describe 'apt::key' do
}
end
it 'fails' do
}
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context "url begin with a dash" do
end
end
context "url begin with a dash" do
@@
-219,7
+219,7
@@
describe 'apt::key' do
:server => "hkp://-pgp.mit.edu",
} end
it 'fails' do
:server => "hkp://-pgp.mit.edu",
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
context 'invalid key' do
end
end
context 'invalid key' do
@@
-227,7
+227,7
@@
describe 'apt::key' do
'Out of rum. Why? Why are we out of rum?'
end
it 'fails' do
'Out of rum. Why? Why are we out of rum?'
end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
end
end
@@
-236,7
+236,7
@@
describe 'apt::key' do
:source => 'afp://puppetlabs.com/key.gpg',
} end
it 'fails' do
:source => 'afp://puppetlabs.com/key.gpg',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
end
end
@@
-245,7
+245,7
@@
describe 'apt::key' do
:content => [],
} end
it 'fails' do
:content => [],
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject
.call
}.to raise_error(/is not a string/)
end
end
end
end
@@
-254,7
+254,7
@@
describe 'apt::key' do
:server => 'two bottles of rum',
} end
it 'fails' do
:server => 'two bottles of rum',
} end
it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ expect { subject
.call
}.to raise_error(/does not match/)
end
end
end
end
@@
-263,18
+263,20
@@
describe 'apt::key' do
:options => {},
} end
it 'fails' do
:options => {},
} end
it 'fails' do
- expect { subject }.to raise_error(/is not a string/)
+ expect { subject
.call
}.to raise_error(/is not a string/)
end
end
context 'invalid ensure' do
end
end
context 'invalid ensure' do
- let :params do
- {
- :ensure => 'foo',
- }
- end
- it 'fails' do
- expect { subject }.to raise_error(/does not match/)
+ %w(foo aabsent absenta apresent presenta).each do |param|
+ let :params do
+ {
+ :ensure => param,
+ }
+ end
+ it 'fails' do
+ expect { subject.call }.to raise_error(/does not match/)
+ end
end
end
end
end
@@
-315,7
+317,7
@@
describe 'apt::key' do
apt::key { 'duplicate': id => '#{title}', ensure => 'absent', }"
end
it 'informs the user of the impossibility' do
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/)
+ expect { subject
.call
}.to raise_error(/already ensured as absent/)
end
end
end
end
end
end