Skip to content

Commit

Permalink
restructure php56 acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 6, 2018
1 parent eb6fcdb commit 6e13e94
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions spec/acceptance/php56_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
require 'spec_helper_acceptance'

describe 'with specific php version' do
case default[:platform]
when %r{ubuntu}
packagename = 'php5.6-fpm'
when %{el}
# ell = Enterprise Linux = CentOS....
packagename = 'php-fpm'
when %r{debian}
packagename = 'php5-fpm'
end

context 'with params' do
it 'works with 5.6' do
pp = <<-EOS
Expand All @@ -17,20 +27,21 @@ class { 'php::globals':
phpunit => false,
}
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{16.04}
describe package('php5.6-fpm') do
it { is_expected.to be_installed }
end
when %r{14.04}
describe package('php5.6-fpm') do
it { is_expected.to be_installed }
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 }
end
describe command('php --version') do
its(:stdout) { is_expected.to match %r{5\.6} }
end
end
end

0 comments on commit 6e13e94

Please sign in to comment.