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
Update CODEOWNERS
[puppet-modules/puppetlabs-apt.git]
/
spec
/
defines
/
source_compat_spec.rb
diff --git
a/spec/defines/source_compat_spec.rb
b/spec/defines/source_compat_spec.rb
index 7eef4fd23e8805d1427c88a5cd7c6c6076bf965a..55be585aa63918a02ceb5c7f649bbd5a8c8e3cc8 100644
(file)
--- a/
spec/defines/source_compat_spec.rb
+++ b/
spec/defines/source_compat_spec.rb
@@
-3,12
+3,8
@@
require 'spec_helper'
describe 'apt::source', type: :define do
require 'spec_helper'
describe 'apt::source', type: :define do
- GPG_KEY_ID = '6F6B15509CF8E59E6E469F327F438280EF8D349F'
-
- let :title do
- 'my_source'
- end
-
+ let(:id) { '6F6B15509CF8E59E6E469F327F438280EF8D349F' }
+ let(:title) { 'my_source' }
let :facts do
{
os: {
let :facts do
{
os: {
@@
-16,13
+12,13
@@
describe 'apt::source', type: :define do
name: 'Debian',
release: {
major: '9',
name: 'Debian',
release: {
major: '9',
- full: '9.0'
,
+ full: '9.0'
},
distro: {
codename: 'stretch',
},
distro: {
codename: 'stretch',
- id: 'Debian'
,
- }
,
- }
,
+ id: 'Debian'
+ }
+ }
}
end
}
end
@@
-30,12
+26,12
@@
describe 'apt::source', type: :define do
let :params do
{
'include' => { 'deb' => false, 'src' => true },
let :params do
{
'include' => { 'deb' => false, 'src' => true },
- 'location' => 'http://debian.mirror.iweb.ca/debian/'
,
+ 'location' => 'http://debian.mirror.iweb.ca/debian/'
}
end
it {
}
end
it {
-
is_expected
.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb-src http://debian.mirror.iweb.ca/debian/ stretch main\n})
+
expect(subject)
.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb-src http://debian.mirror.iweb.ca/debian/ stretch main\n})
}
end
}
end
@@
-47,27
+43,27
@@
describe 'apt::source', type: :define do
'release' => 'sid',
'repos' => 'testing',
'include' => { 'src' => false },
'release' => 'sid',
'repos' => 'testing',
'include' => { 'src' => false },
- 'key' =>
GPG_KEY_ID
,
+ 'key' =>
id
,
'pin' => '10',
'architecture' => 'x86_64',
'pin' => '10',
'architecture' => 'x86_64',
- 'allow_unsigned' => true
,
+ 'allow_unsigned' => true
}
end
it {
}
end
it {
-
is_expected
.to contain_apt__setting('list-my_source').with_content(%r{# foo\ndeb \[arch=x86_64 trusted=yes\] http://debian.mirror.iweb.ca/debian/ sid testing\n})
- .without_content(%r{deb-src})
+
expect(subject)
.to contain_apt__setting('list-my_source').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 {
-
is_expected
.to contain_apt__pin('my_source').that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
- 'priority' => '10',
- 'origin' => 'debian.mirror.iweb.ca')
+
expect(subject)
.to contain_apt__pin('my_source').that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
+
'priority' => '10',
+
'origin' => 'debian.mirror.iweb.ca')
}
it {
}
it {
-
is_expected.to contain_apt__key("Add key: #{GPG_KEY_ID
} from Apt::Source my_source").that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
-
'id' => GPG_KEY_ID
)
+
expect(subject).to contain_apt__key("Add key: #{id
} from Apt::Source my_source").that_comes_before('Apt::Setting[list-my_source]').with('ensure' => 'present',
+
'id' => id
)
}
end
}
end
@@
-76,7
+72,7
@@
describe 'apt::source', type: :define do
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'allow_insecure' => true
,
+ 'allow_insecure' => true
}
end
}
end
@@
-88,7
+84,7
@@
describe 'apt::source', type: :define do
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
{
'include' => { 'src' => false },
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'allow_unsigned' => true
,
+ 'allow_unsigned' => true
}
end
}
end
@@
-99,24
+95,24
@@
describe 'apt::source', type: :define do
let :params do
{
'location' => 'http://debian.mirror.iweb.ca/debian/',
let :params do
{
'location' => 'http://debian.mirror.iweb.ca/debian/',
- 'architecture' => 'x86_64'
,
+ 'architecture' => 'x86_64'
}
end
it {
}
end
it {
-
is_expected
.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[arch=x86_64\] http://debian.mirror.iweb.ca/debian/ stretch main\n})
+
expect(subject)
.to contain_apt__setting('list-my_source').with_content(%r{# my_source\ndeb \[arch=x86_64\] http://debian.mirror.iweb.ca/debian/ stretch main\n})
}
end
context 'with ensure => absent' do
let :params do
{
}
end
context 'with ensure => absent' do
let :params do
{
- 'ensure' => 'absent'
,
+ 'ensure' => 'absent'
}
end
it {
}
end
it {
-
is_expected
.to contain_apt__setting('list-my_source').with('ensure' => 'absent')
+
expect(subject)
.to contain_apt__setting('list-my_source').with('ensure' => 'absent')
}
end
}
end
@@
-129,17
+125,17
@@
describe 'apt::source', type: :define do
name: 'Debian',
release: {
major: '8',
name: 'Debian',
release: {
major: '8',
- full: '8.0'
,
+ full: '8.0'
},
distro: {
},
distro: {
- id: 'Debian'
,
- }
,
- }
,
+ id: 'Debian'
+ }
+ }
}
end
it do
}
end
it do
-
is_expected
.to raise_error(Puppet::Error, %r{os.distro.codename fact not available: release parameter required})
+
expect(subject)
.to raise_error(Puppet::Error, %r{os.distro.codename fact not available: release parameter required})
end
end
end
end
end
end