From 5047ec5213d04442104571b74bced2a2126e7d9c Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Sat, 17 Feb 2024 01:46:58 +0100 Subject: [PATCH] Move away from legacy facts in the test suite --- spec/classes/redis_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/classes/redis_spec.rb b/spec/classes/redis_spec.rb index 9629a42a..6d72a062 100644 --- a/spec/classes/redis_spec.rb +++ b/spec/classes/redis_spec.rb @@ -74,7 +74,7 @@ class { 'redis::globals': it { is_expected.to compile.with_all_deps } - if facts[:operatingsystem] == 'CentOS' + if facts[:os]['name'] == 'CentOS' it { is_expected.to contain_package('centos-release-scl-rh') } else it { is_expected.not_to contain_package('centos-release-scl-rh') } @@ -501,7 +501,7 @@ class { 'redis': describe 'with parameter: manage_repo' do let(:params) { { manage_repo: true } } - if facts[:osfamily] == 'RedHat' && facts[:os]['release']['major'].to_i <= 7 + if facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i <= 7 it { is_expected.to contain_class('epel') } else it { is_expected.not_to contain_class('epel') } @@ -510,7 +510,7 @@ class { 'redis': describe 'with ppa' do let(:params) { super().merge(ppa_repo: 'ppa:rwky/redis') } - if facts[:operatingsystem] == 'Ubuntu' + if facts[:os]['name'] == 'Ubuntu' it { is_expected.to contain_apt__ppa('ppa:rwky/redis') } else it { is_expected.not_to contain_apt__ppa('ppa:rwky/redis') }