Skip to content

Commit

Permalink
Simplify mod::php unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Oct 11, 2023
1 parent b3f5f8c commit 541c316
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions spec/classes/mod/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,6 @@
end

case facts[:os]['release']['major']
when '9'
context 'on stretch' do
it { is_expected.to contain_apache__mod('php7.0') }
it { is_expected.to contain_package('libapache2-mod-php7.0') }

it {
expect(subject).to contain_file('php7.0.load').with(
content: "LoadModule php7_module /usr/lib/apache2/modules/libphp7.0.so\n",
)
}
end
when '10'
context 'on buster' do
it { is_expected.to contain_apache__mod('php7.3') }
Expand Down Expand Up @@ -290,12 +279,7 @@
end

# all the following tests are for legacy php/apache versions. They don't work on modern ubuntu and redhat 8
next if (facts[:os]['release']['major'].to_i >= 15 && facts[:os]['name'] == 'SLES') ||
(facts[:os]['family'] == 'Debian') ||
(facts[:os]['release']['major'].to_i >= 8 && (facts[:os]['name'] == 'RedHat' || facts[:os]['name'] == 'CentOS' ||
facts[:os]['name'] == 'Rocky' || facts[:os]['name'] == 'AlmaLinux'))

describe 'OS independent tests' do
describe 'OS independent tests', unless: (['Debian', 'RedHat'].include?(facts[:os]['family'])) || (facts[:os]['release']['major'].to_i >= 15 && facts[:os]['name'] == 'SLES') do
context 'with content param' do
let :params do
{ content: 'somecontent' }
Expand Down

0 comments on commit 541c316

Please sign in to comment.