Skip to content

Commit 4b6742b

Browse files
kenyonbastelfreak
authored andcommitted
backports unit tests: minor fixes and updates
* Use `include apt` instead of a resource-like class declaration * Use modern Debian and Ubuntu releases * Correct the Ubuntu major version
1 parent 3e364df commit 4b6742b

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

spec/classes/apt_backports_spec.rb

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
require 'spec_helper'
44

55
describe 'apt::backports', type: :class do
6-
let(:pre_condition) { "class{ '::apt': }" }
6+
let(:pre_condition) { 'include apt' }
77

88
describe 'debian/ubuntu tests' do
9-
context 'with defaults on deb' do
9+
context 'with defaults on debian' do
1010
let(:facts) do
1111
{
1212
os: {
1313
family: 'Debian',
1414
name: 'Debian',
1515
release: {
16-
major: '9',
17-
full: '9.0'
16+
full: '11.8',
17+
major: '11',
18+
minor: '8'
1819
},
1920
distro: {
20-
codename: 'stretch',
21+
codename: 'bullseye',
2122
id: 'Debian'
2223
}
2324
}
@@ -27,8 +28,8 @@
2728
it {
2829
expect(subject).to contain_apt__source('backports').with(location: 'http://deb.debian.org/debian',
2930
repos: 'main contrib non-free',
30-
release: 'stretch-backports',
31-
pin: { 'priority' => 200, 'release' => 'stretch-backports' })
31+
release: 'bullseye-backports',
32+
pin: { 'priority' => 200, 'release' => 'bullseye-backports' })
3233
}
3334
end
3435

@@ -39,11 +40,11 @@
3940
family: 'Debian',
4041
name: 'Ubuntu',
4142
release: {
42-
major: '18',
43-
full: '18.04'
43+
major: '22.04',
44+
full: '22.04'
4445
},
4546
distro: {
46-
codename: 'bionic',
47+
codename: 'jammy',
4748
id: 'Ubuntu'
4849
}
4950
}
@@ -53,8 +54,8 @@
5354
it {
5455
expect(subject).to contain_apt__source('backports').with(location: 'http://archive.ubuntu.com/ubuntu',
5556
repos: 'main universe multiverse restricted',
56-
release: 'bionic-backports',
57-
pin: { 'priority' => 200, 'release' => 'bionic-backports' })
57+
release: 'jammy-backports',
58+
pin: { 'priority' => 200, 'release' => 'jammy-backports' })
5859
}
5960
end
6061

@@ -65,11 +66,11 @@
6566
family: 'Debian',
6667
name: 'Ubuntu',
6768
release: {
68-
major: '18',
69-
full: '18.04'
69+
major: '22.04',
70+
full: '22.04'
7071
},
7172
distro: {
72-
codename: 'bionic',
73+
codename: 'jammy',
7374
id: 'Ubuntu'
7475
}
7576
}
@@ -101,11 +102,11 @@
101102
family: 'Debian',
102103
name: 'Ubuntu',
103104
release: {
104-
major: '18',
105-
full: '18.04'
105+
major: '22.04',
106+
full: '22.04'
106107
},
107108
distro: {
108-
codename: 'bionic',
109+
codename: 'jammy',
109110
id: 'Ubuntu'
110111
}
111112
}
@@ -230,11 +231,11 @@
230231
family: 'Debian',
231232
name: 'Ubuntu',
232233
release: {
233-
major: '18',
234-
full: '18.04'
234+
major: '22.04',
235+
full: '22.04'
235236
},
236237
distro: {
237-
codename: 'bionic',
238+
codename: 'jammy',
238239
id: 'Ubuntu'
239240
}
240241
}

0 commit comments

Comments
 (0)