Skip to content

Commit

Permalink
Add acceptance tests for system php with extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Sep 15, 2018
1 parent 9634ea1 commit aaeb555
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions spec/acceptance/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,44 @@
it { is_expected.to be_installed }
end

describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
end
context 'default parameters with extensions' do
it 'works with defaults' do
pp = <<-EOS
class{'php':
extensions => {
'mysql' => {},
'gd' => {}
}
}
EOS
# Run it twice and test for idempotency
apply_manifest(pp, catch_failures: true)
apply_manifest(pp, catch_changes: true)
end

case default[:platform]
when %r{ubuntu-18.04}
packagename = 'php7.2-fpm'
when %r{ubuntu-16.04}
packagename = 'php7.0-fpm'
when %r{ubuntu-14.04}
packagename = 'php5-fpm'
when %r{el}
packagename = 'php-fpm'
when %r{debian-8}
packagename = 'php5-fpm'
when %r{debian-9}
packagename = 'php7.0-fpm'
end
describe package(packagename) do
it { is_expected.to be_installed }
end

describe service(packagename) do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
Expand Down

0 comments on commit aaeb555

Please sign in to comment.