module-nginx/spec/classes/service_spec.rb
Matthew Haughton eb31df40d6 Remove vhost and mailhost vhost_autogen.conf
Don't generate it anymore, and remove any existing file from
people's systems
2013-11-30 21:24:55 -05:00

39 lines
998 B
Ruby

require 'spec_helper'
describe 'nginx::service' do
let :facts do {
:osfamily => 'Debian',
:operatingsystem => 'debian',
:kernel => 'Linux',
} end
let :pre_condition do
[
'include ::nginx::params',
]
end
context "using default parameters" do
it { should contain_service('nginx').with(
:ensure => 'running',
:enable => true,
:hasstatus => true,
:hasrestart => true
)}
it { should contain_service('nginx').without_restart }
end
describe "when configtest_enable => true" do
let(:params) {{ :configtest_enable => true }}
it { should 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) {{ :configtest_enable => true, :service_restart => 'a restart command' }}
it { should contain_service('nginx').with_restart('a restart command') }
end
end
end