Skip to content

Commit

Permalink
Move away from legacy facts in the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed Feb 17, 2024
1 parent 99e8e2f commit 5047ec5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/classes/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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') }
Expand Down Expand Up @@ -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') }
Expand All @@ -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') }
Expand Down

0 comments on commit 5047ec5

Please sign in to comment.