module-nginx/spec/system/nginx_mail_spec.rb
Matthew Haughton 0922eb7210 check for 0 or 2 exit code
See http://docs.puppetlabs.com/man/apply.html

puppet_apply from rspec-system-puppet runs with --detailed-exitcodes
2013-11-30 19:11:00 -05:00

38 lines
936 B
Ruby

require 'spec_helper_system'
describe "nginx::resource::mailhost define:" do
it 'should run successfully' do
pp = "
class { 'nginx':
mail => true,
}
nginx::resource::vhost { 'www.puppetlabs.com':
ensure => present,
www_root => '/var/www/www.puppetlabs.com',
}
nginx::resource::mailhost { 'domain1.example':
ensure => present,
auth_http => 'localhost/cgi-bin/auth',
protocol => 'smtp',
listen_port => 587,
ssl_port => 465,
xclient => 'off',
}
"
puppet_apply(pp) do |r|
[0,2].should include r.exit_code
r.refresh
# Not until deprecated variables fixed.
#r.stderr.should be_empty
r.exit_code.should be_zero
end
end
describe file('/etc/nginx/conf.mail.d/vhost_autogen.conf') do
it { should be_file }
it { should contain "auth_http localhost/cgi-bin/auth;" }
end
end