-
-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #375 from dbeckham/fix_os_version_comparison
Fix OS fact comparison for Ubuntu 12 and 14
- Loading branch information
Showing
4 changed files
with
47 additions
and
2 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
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
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
require 'spec_helper' | ||
|
||
describe 'php::fpm::service', type: :class do | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
let :facts do | ||
facts | ||
end | ||
|
||
let(:pre_condition) { 'class {"php": fpm => true}' } | ||
|
||
describe 'when called with no parameters' do | ||
# rubocop:disable RSpec/RepeatedExample | ||
case facts[:osfamily] | ||
when 'Debian' | ||
it { is_expected.to contain_service('php5-fpm').with_ensure('running') } | ||
if facts[:operatingsystem] == 'Ubuntu' | ||
if facts[:operatingsystemrelease] == '12.04' | ||
it { is_expected.to contain_service('php5-fpm').without_restart } | ||
else | ||
it { is_expected.to contain_service('php5-fpm').with_restart('service php5-fpm reload') } | ||
end | ||
end | ||
when 'Suse' | ||
it { is_expected.to contain_service('php-fpm').with_ensure('running') } | ||
when 'FreeBSD' | ||
it { is_expected.to contain_service('php-fpm').with_ensure('running') } | ||
else | ||
it { is_expected.to contain_service('php-fpm').with_ensure('running') } | ||
end | ||
end | ||
end | ||
end | ||
end |
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