File tree 1 file changed +34
-1
lines changed
1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 4
4
5
5
describe 'apt::source_deb822' do
6
6
let ( :title ) { 'namevar' }
7
+ let ( :pre_condition ) { 'include apt' }
7
8
let ( :params ) do
8
9
{ }
9
10
end
10
11
12
+ context 'with defaults' do
13
+ it { is_expected . to raise_error ( Puppet ::Error ) }
14
+ end
15
+
11
16
on_supported_os . each do |os , os_facts |
12
17
context "on #{ os } " do
13
18
let ( :facts ) { os_facts }
14
19
15
- it { is_expected . to compile }
20
+ context 'puppetlabs source' do
21
+ let ( :title ) { 'puppetlabs' }
22
+ let ( :params ) do
23
+ super ( ) . merge (
24
+ {
25
+ 'comment' => 'Manage the puppetlabs repo' ,
26
+ 'uris' => [ 'http://apt.puppet.com' ] ,
27
+ 'suites' => [ facts [ 'codename' ] . to_s ] ,
28
+ 'components' => [ 'puppet8' ] ,
29
+ 'signed_by' => [ '/etc/apt/keyrings/puppetlabs.gpg' ] ,
30
+ } ,
31
+ )
32
+ end
33
+
34
+ it { is_expected . to contain_apt__setting ( "source-#{ title } " ) }
35
+ it { is_expected . to contain_file ( "/etc/apt/sources.list.d/#{ title } .sources" ) . with_content ( %r{^# #{ params [ 'comment' ] } } ) }
36
+
37
+ context 'disable repo' do
38
+ let ( :params ) do
39
+ super ( ) . merge (
40
+ {
41
+ 'enabled' => false ,
42
+ } ,
43
+ )
44
+ end
45
+
46
+ it { is_expected . to contain_file ( "/etc/apt/sources.list.d/#{ title } .sources" ) . with_content ( %r{^Enabled: no} ) }
47
+ end
48
+ end
16
49
end
17
50
end
18
51
end
You can’t perform that action at this time.
0 commit comments