Skip to content

Commit d3bcca3

Browse files
committed
Updated spec tests for new CentOS/RHEL 8 defaults
1 parent bc76221 commit d3bcca3

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

spec/classes/rabbitmq_spec.rb

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
context 'with default params' do
3030
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
3131
it { is_expected.not_to contain_apt__source('rabbitmq') }
32-
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
33-
it { is_expected.not_to contain_yumrepo('rabbitmq') }
32+
if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'] == '8'
33+
it { is_expected.to contain_class('rabbitmq::repo::rhel') }
34+
it { is_expected.to contain_yumrepo('rabbitmq') }
35+
else
36+
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
37+
it { is_expected.not_to contain_yumrepo('rabbitmq') }
38+
end
3439
end
3540

3641
context 'with service_restart => false' do
@@ -206,12 +211,18 @@
206211
is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin')
207212
end
208213
end
209-
if %w[RedHat Debian SUSE].include?(facts[:os]['family'])
214+
if %w[Debian SUSE].include?(facts[:os]['family'])
210215
it { is_expected.to contain_package('python') }
211-
end
212216
if %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
213217
it { is_expected.to contain_package('python2') }
214218
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
215226
end
216227
context 'with manage_python false' do
217228
let(:params) { { manage_python: false } }
@@ -220,6 +231,7 @@
220231
is_expected.to contain_class('rabbitmq::install::rabbitmqadmin')
221232
is_expected.not_to contain_package('python')
222233
is_expected.not_to contain_package('python2')
234+
is_expected.not_to contain_package('python3')
223235
end
224236
end
225237

0 commit comments

Comments
 (0)