module-nginx/spec/classes/service_spec.rb
Matthew Haughton a002d8932e bug fixes surfaced by future parser
* concat::fragment requires 'order' to be a string
* init parameters added in #373 referred to wrong variable name in params.pp
* cannot perform regex match on a number, so make {fastcgi,proxy}_cache_levels
  a string by default
* bug fixed in test suite
2014-09-04 23:24:14 -04:00

46 lines
1.3 KiB
Ruby

require 'spec_helper'
describe 'nginx::service' do
let :facts do {
:osfamily => 'Debian',
:operatingsystem => 'debian',
} end
let :params do {
:configtest_enable => false,
:service_restart => '/etc/init.d/nginx configtest && /etc/init.d/nginx restart',
:service_ensure => 'running',
} end
context "using default parameters" do
it { is_expected.to contain_service('nginx').with(
:ensure => 'running',
:enable => true,
:hasstatus => true,
:hasrestart => true
)}
it { is_expected.to contain_service('nginx').without_restart }
end
describe "when configtest_enable => true" do
let :params do {
:configtest_enable => true,
:service_restart => '/etc/init.d/nginx configtest && /etc/init.d/nginx restart',
:service_ensure => 'running',
} end
it { is_expected.to contain_service('nginx').with_restart('/etc/init.d/nginx configtest && /etc/init.d/nginx restart') }
context "when service_restart => 'a restart command'" do
let :params do {
:configtest_enable => true,
:service_restart => 'a restart command',
:service_ensure => 'running',
} end
it { is_expected.to contain_service('nginx').with_restart('a restart command') }
end
end
end