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 3bc68e3
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

Check failure on line 282 in spec/classes/mod/php_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Performance/CollectionLiteralInLoop: Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.

Check failure on line 282 in spec/classes/mod/php_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Performance/CollectionLiteralInLoop: Avoid immutable Array literals in loops. It is better to extract it into a local variable or a constant.
context 'with content param' do
let :params do
{ content: 'somecontent' }
Expand Down

0 comments on commit 3bc68e3

Please sign in to comment.