File tree Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Expand file tree Collapse file tree 2 files changed +16
-14
lines changed Original file line number Diff line number Diff line change 190190
191191 context 'with service_manage set to true' do
192192 let ( :params ) { { admin_enable : true , management_ip_address : '1.1.1.1' , service_manage : true } }
193+ let ( :python_package ) do
194+ if %w[ Debian SUSE ] . include? ( facts [ :os ] [ 'family' ] )
195+ 'python'
196+ elsif %w[ FreeBSD OpenBSD ] . include? ( facts [ :os ] [ 'family' ] )
197+ 'python2'
198+ elsif facts [ :os ] [ 'family' ] == 'RedHat'
199+ if facts [ :os ] [ 'release' ] [ 'major' ] == '8'
200+ 'python3'
201+ else
202+ 'python'
203+ end
204+ end
205+ end
193206
194207 context 'with rabbitmqadmin_package set to blub' do
195208 let ( :params ) { { rabbitmqadmin_package : 'blub' } }
211224 is_expected . to contain_archive ( 'rabbitmqadmin' ) . with_source ( 'http://1.1.1.1:15672/cli/rabbitmqadmin' )
212225 end
213226 end
214- if %w[ Debian SUSE ] . include? ( facts [ :os ] [ 'family' ] )
215- it { is_expected . to contain_package ( 'python' ) }
216- if %w[ FreeBSD OpenBSD ] . include? ( facts [ :os ] [ 'family' ] )
217- it { is_expected . to contain_package ( 'python2' ) }
218- end
219- if facts [ :os ] [ 'family' ] == 'RedHat'
220- if facts [ :os ] [ 'release' ] [ 'major' ] == '8'
221- it { is_expected . to contain_package ( 'python3' ) }
222- else
223- it { is_expected . to contain_package ( 'python' ) }
224- end
225- end
227+ it { is_expected . to contain_package ( python_package ) }
226228 end
227229 context 'with manage_python false' do
228230 let ( :params ) { { manage_python : false } }
Original file line number Diff line number Diff line change 9595
9696shared_examples 'an idempotent resource' do
9797 it 'applies with no errors' do
98- apply_manifest ( pp , catch_failures : true )
98+ apply_manifest ( pp , catch_failures : true , debug : true )
9999 end
100100
101101 it 'applies a second time without changes' do
102- apply_manifest ( pp , catch_changes : true )
102+ apply_manifest ( pp , catch_changes : true , debug : true )
103103 end
104104end
You can’t perform that action at this time.
0 commit comments