module-nginx/spec/classes/nginx_spec.rb

70 lines
2.2 KiB
Ruby
Raw Normal View History

require 'spec_helper'
describe 'nginx' do
2013-11-22 04:10:53 +01:00
let :params do
{
:nginx_upstreams => { 'upstream1' => { 'members' => ['localhost:3000']} },
:nginx_vhosts => { 'test2.local' => { 'www_root' => '/' } },
:nginx_locations => { 'test2.local' => { 'vhost' => 'test2.local', 'www_root' => '/'} }
}
end
2013-11-22 04:10:53 +01:00
context "on a Debian OS" do
let :facts do
{
:kernel => 'linux',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:lsbdistcodename => 'precise',
2013-12-01 01:18:15 +01:00
:concat_basedir => '/var/lib/puppet/concat',
2013-11-22 04:10:53 +01:00
}
end
2013-11-22 04:10:53 +01:00
it { should contain_nginx__package }
it { should contain_nginx__config }
it { should contain_nginx__service }
it { should include_class("nginx::params") }
it { should contain_nginx__resource__upstream("upstream1") }
it { should contain_nginx__resource__vhost("test2.local") }
it { should contain_nginx__resource__location("test2.local") }
end
2013-11-22 04:10:53 +01:00
context "on a RedHat OS" do
let :facts do
{
:kernel => 'linux',
:operatingsystem => 'RedHat',
:osfamily => 'RedHat',
2013-12-01 01:18:15 +01:00
:concat_basedir => '/var/lib/puppet/concat',
2013-11-22 04:10:53 +01:00
}
end
2013-11-22 04:10:53 +01:00
it { should contain_nginx__package }
it { should contain_nginx__config }
it { should contain_nginx__service }
it { should include_class("nginx::params") }
it { should contain_nginx__resource__upstream("upstream1") }
it { should contain_nginx__resource__vhost("test2.local") }
it { should contain_nginx__resource__location("test2.local") }
end
2013-11-22 04:10:53 +01:00
context "on a Suse OS" do
let :facts do
{
:kernel => 'linux',
:operatingsystem => 'SuSE',
:osfamily => 'Suse',
2013-12-01 01:18:15 +01:00
:concat_basedir => '/var/lib/puppet/concat',
2013-11-22 04:10:53 +01:00
}
end
2013-11-22 04:10:53 +01:00
it { should contain_nginx__package }
it { should contain_nginx__config }
it { should contain_nginx__service }
it { should include_class("nginx::params") }
it { should contain_nginx__resource__upstream("upstream1") }
it { should contain_nginx__resource__vhost("test2.local") }
it { should contain_nginx__resource__location("test2.local") }
end
end