File tree Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Expand file tree Collapse file tree 1 file changed +34
-1
lines changed Original file line number Diff line number Diff line change 44
55describe 'apt::source_deb822' do
66 let ( :title ) { 'namevar' }
7+ let ( :pre_condition ) { 'include apt' }
78 let ( :params ) do
89 { }
910 end
1011
12+ context 'with defaults' do
13+ it { is_expected . to raise_error ( Puppet ::Error ) }
14+ end
15+
1116 on_supported_os . each do |os , os_facts |
1217 context "on #{ os } " do
1318 let ( :facts ) { os_facts }
1419
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
1649 end
1750 end
1851end
You can’t perform that action at this time.
0 commit comments