-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(package): fix package spec in case of multi Php versions
- Loading branch information
1 parent
d4772f9
commit 59f648c
Showing
1 changed file
with
53 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,61 @@ | ||
control 'Php package' do | ||
title 'should be installed' | ||
|
||
pkg_name = | ||
case os[:family] | ||
when 'debian' | ||
case os[:name] | ||
when 'ubuntu' | ||
'php' | ||
when 'debian' | ||
'php7.0' | ||
|
||
|
||
def test_debian | ||
describe package('php-imagick') do | ||
it { should be_installed } | ||
end | ||
|
||
describe package('php-redis') do | ||
it { should be_installed } | ||
end | ||
|
||
%w[ | ||
bz2 cli curl fpm gd imap intl mbstring | ||
mysql readline xml zip | ||
].each do |pkg| | ||
|
||
describe package("php5.6-#{pkg}") do | ||
it { should be_installed } | ||
end | ||
when 'redhat', 'fedora' | ||
'php' | ||
when 'suse' | ||
'php5' | ||
|
||
describe package("php7.3-#{pkg}") do | ||
it { should be_installed } | ||
end | ||
end | ||
end | ||
|
||
def test_ubuntu | ||
describe package(pkg_name) do | ||
it { should be_installed } | ||
end | ||
end | ||
|
||
def test_redhat | ||
describe package('php') do | ||
it { should be_installed } | ||
end | ||
end | ||
|
||
describe package(pkg_name) do | ||
it { should be_installed } | ||
def test_suse | ||
describe package('php5') do | ||
it { should be_installed } | ||
end | ||
end | ||
|
||
case os[:family] | ||
when 'debian' | ||
case os[:name] | ||
when 'ubuntu' | ||
test_ubuntu | ||
when 'debian' | ||
test_debian | ||
end | ||
when 'redhat', 'fedora' | ||
test_redhat | ||
when 'suse' | ||
test_suse | ||
end | ||
end |