diff --git a/spec/classes/nginx_spec.rb b/spec/classes/nginx_spec.rb index aac7fcc..2580b88 100644 --- a/spec/classes/nginx_spec.rb +++ b/spec/classes/nginx_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe 'nginx' do shared_examples 'linux' do |operatingsystem, user| - let(:facts) {{ :kernel => 'linux', :operatingsystem => operatingsystem, :osfamily => operatingsystem }} + let(:facts) {{ :kernel => 'linux', :operatingsystem => operatingsystem, :osfamily => operatingsystem, :lsbdistcodename => 'precise' }} it { should contain_service('nginx').with( :ensure => 'running', diff --git a/spec/classes/package_spec.rb b/spec/classes/package_spec.rb index 5c53b52..6b2d7f8 100644 --- a/spec/classes/package_spec.rb +++ b/spec/classes/package_spec.rb @@ -5,15 +5,12 @@ describe 'nginx::package' do shared_examples 'redhat' do |operatingsystem| let(:facts) {{ :operatingsystem => operatingsystem, :osfamily => 'RedHat' }} it { should contain_package('nginx') } - it { should contain_package('gd') } - it { should contain_package('libXpm') } - it { should contain_package('libxslt') } it { should contain_yumrepo('nginx-release').with_enabled('1') } end - shared_examples 'debian' do |operatingsystem| - let(:facts) {{ :operatingsystem => operatingsystem, :osfamily => 'Debian'}} - it { should contain_file('/etc/apt/sources.list.d/nginx.list') } + shared_examples 'debian' do |operatingsystem, lsbdistcodename| + let(:facts) {{ :operatingsystem => operatingsystem, :osfamily => 'Debian', :lsbdistcodename => lsbdistcodename }} + it { should contain_apt__source('nginx') } end shared_examples 'suse' do |operatingsystem| @@ -35,8 +32,8 @@ describe 'nginx::package' do end context 'debian' do - it_behaves_like 'debian', 'debian' - it_behaves_like 'debian', 'ubuntu' + it_behaves_like 'debian', 'debian', 'wheezy' + it_behaves_like 'debian', 'ubuntu', 'precise' end context 'suse' do @@ -54,9 +51,6 @@ describe 'nginx::package' do # including nginx-release let(:facts) {{ :operatingsystem => 'Fedora', :osfamily => 'RedHat' }} it { should contain_package('nginx') } - it { should contain_package('gd') } - it { should contain_package('libXpm') } - it { should contain_package('libxslt') } it { should_not contain_yumrepo('nginx-release') } end diff --git a/spec/defines/nginx__resource__vhost_spec.rb b/spec/defines/nginx__resource__vhost_spec.rb index ff17db7..315694c 100644 --- a/spec/defines/nginx__resource__vhost_spec.rb +++ b/spec/defines/nginx__resource__vhost_spec.rb @@ -11,12 +11,12 @@ describe 'nginx::resource::vhost' do }} it 'applies location_allow rules' do - should contain_file('/nginx.d/test-500-test-default').with({ + should contain_file('/nginx.d/test-500-_').with({ 'content' => /allow 10.0.0.1\n allow host1/ }) end it 'applies location_deny rules' do - should contain_file('/nginx.d/test-500-test-default').with({ + should contain_file('/nginx.d/test-500-_').with({ 'content' => /deny host2\n deny 10.0.0.2/ }) end