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-6476) - Release prep apt 4.5.0
[puppet-modules/puppetlabs-apt.git]
/
spec
/
defines
/
source_spec.rb
diff --git
a/spec/defines/source_spec.rb
b/spec/defines/source_spec.rb
index eaa08874ef932ca8b37fca6c94d119908d5e77c9..a9077e976e6b98c01df7c0d5213a6dd305cdc352 100644
(file)
--- a/
spec/defines/source_spec.rb
+++ b/
spec/defines/source_spec.rb
@@
-11,7
+11,7
@@
describe 'apt::source' do
'my_source'
end
'my_source'
end
- context 'defaults' do
+ context '
with
defaults' do
context 'without location' do
let :facts do
{
context 'without location' do
let :facts do
{
@@
-23,9
+23,7
@@
describe 'apt::source' do
end
it do
end
it do
- expect {
- subject.call
- }.to raise_error(Puppet::Error, %r{source entry without specifying a location})
+ is_expected.to raise_error(Puppet::Error, %r{source entry without specifying a location})
end
end
context 'with location' do
end
end
context 'with location' do
@@
-98,7
+96,8
@@
describe 'apt::source' do
end
it {
end
it {
- is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength
+ is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n})
+ .without_content(%r{deb-src})
}
it {
}
it {
@@
-130,7
+129,8
@@
describe 'apt::source' do
end
it {
end
it {
- is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength
+ is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n})
+ .without_content(%r{deb-src})
}
it {
}
it {
@@
-163,7
+163,8
@@
describe 'apt::source' do
end
it {
end
it {
- is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(/# foo\ndeb \[arch=x86_64 trusted=yes\] http:\/\/debian\.mirror\.iweb\.ca\/debian\/ sid testing\n/).without_content(%r{deb-src}) # rubocop:disable Metrics/LineLength
+ is_expected.to contain_apt__setting('list-my_source').with(ensure: 'present').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n})
+ .without_content(%r{deb-src})
}
it {
}
it {
@@
-179,7
+180,7
@@
describe 'apt::source' do
end
end
end
end
- context 'allow_unsigned true' do
+ context '
with
allow_unsigned true' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-201,7
+202,7
@@
describe 'apt::source' do
}
end
}
end
- context 'architecture equals x86_64' do
+ context '
with
architecture equals x86_64' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-247,7
+248,7
@@
describe 'apt::source' do
}
end
}
end
- context 'include_src => true' do
+ context '
with
include_src => true' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-269,7
+270,7
@@
describe 'apt::source' do
}
end
}
end
- context 'include deb => false' do
+ context '
with
include deb => false' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-292,7
+293,7
@@
describe 'apt::source' do
it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there wheezy main\n}) }
end
it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there wheezy main\n}) }
end
- context 'include src => true and include deb => false' do
+ context '
with
include src => true and include deb => false' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-315,7
+316,7
@@
describe 'apt::source' do
it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there wheezy main\n}) }
end
it { is_expected.to contain_apt__setting('list-my_source').without_content(%r{deb hello.there wheezy main\n}) }
end
- context 'ensure => absent' do
+ context '
with
ensure => absent' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-337,7
+338,7
@@
describe 'apt::source' do
end
describe 'validation' do
end
describe 'validation' do
- context 'no release' do
+ context '
with
no release' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-349,13
+350,11
@@
describe 'apt::source' do
let(:params) { { location: 'hello.there' } }
it do
let(:params) { { location: 'hello.there' } }
it do
- expect {
- subject.call
- }.to raise_error(Puppet::Error, %r{lsbdistcodename fact not available: release parameter required})
+ is_expected.to raise_error(Puppet::Error, %r{lsbdistcodename fact not available: release parameter required})
end
end
end
end
- context 'release is empty string' do
+ context '
with
release is empty string' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-369,7
+368,7
@@
describe 'apt::source' do
it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{hello\.there main}) }
end
it { is_expected.to contain_apt__setting('list-my_source').with_content(%r{hello\.there main}) }
end
- context 'invalid pin' do
+ context '
with
invalid pin' do
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
let :facts do
{
os: { family: 'Debian', name: 'Debian', release: { major: '7', full: '7.0' } },
@@
-387,9
+386,7
@@
describe 'apt::source' do
end
it do
end
it do
- expect {
- subject.call
- }.to raise_error(Puppet::Error, %r{invalid value for pin})
+ is_expected.to raise_error(Puppet::Error, %r{expects a value})
end
end
end
end