diff --git a/.fixtures.yml b/.fixtures.yml index ca99607..6297887 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -4,7 +4,8 @@ fixtures: "monitor": "git://github.com/example42/puppet-monitor.git" "firewall": "git://github.com/example42/puppet-firewall.git" "iptables": "git://github.com/example42/puppet-iptables.git" - "concat": "git://github.com/example42/puppet-concat.git" + "concat": "git://github.com/puppetlabs/puppetlabs-concat.git" + "stdlib": "git://github.com/puppetlabs/puppetlabs-stdlib.git" symlinks: "php": "#{source_dir}" diff --git a/manifests/ini.pp b/manifests/ini.pp index 3fce1cc..4854863 100644 --- a/manifests/ini.pp +++ b/manifests/ini.pp @@ -37,7 +37,7 @@ default => '/', } - if ("${sapi_target}" == "all"){ + if ($sapi_target == 'all') { file { "${config_dir}${http_sapi}conf.d/${target}": ensure => 'present', diff --git a/spec/classes/php_spec.rb b/spec/classes/php_spec.rb index be9a4e3..a57059c 100644 --- a/spec/classes/php_spec.rb +++ b/spec/classes/php_spec.rb @@ -25,50 +25,26 @@ describe 'Test customizations - template' do let(:params) { {:template => "php/spec.erb" , :options => { 'opt_a' => 'value_a' } } } - - it 'should generate a valid template' do - content = catalogue.resource('file', 'php.conf').send(:parameters)[:content] - content.should match "fqdn: rspec.example42.com" - end - it 'should generate a template that uses custom options' do - content = catalogue.resource('file', 'php.conf').send(:parameters)[:content] - content.should match "value_a" - end - + it { should contain_file('php.conf').with_content(/fqdn: rspec.example42.com/) } + it { should contain_file('php.conf').with_content(/value_a/) } end describe 'Test customizations - source' do let(:params) { {:source => "puppet://modules/php/spec" , :source_dir => "puppet://modules/php/dir/spec" , :source_dir_purge => true } } - - it 'should request a valid source ' do - content = catalogue.resource('file', 'php.conf').send(:parameters)[:source] - content.should == "puppet://modules/php/spec" - end - it 'should request a valid source dir' do - content = catalogue.resource('file', 'php.dir').send(:parameters)[:source] - content.should == "puppet://modules/php/dir/spec" - end - it 'should purge source dir if source_dir_purge is true' do - content = catalogue.resource('file', 'php.dir').send(:parameters)[:purge] - content.should == true - end + it { should contain_file('php.conf').with_source('puppet://modules/php/spec') } + it { should contain_file('php.dir').with_source('puppet://modules/php/dir/spec') } + it { should contain_file('php.dir').with_purge('true') } end describe 'Test customizations - custom class' do let(:params) { {:my_class => "php::spec" } } - it 'should automatically include a custom class' do - content = catalogue.resource('file', 'php.conf').send(:parameters)[:content] - content.should match "fqdn: rspec.example42.com" - end + it { should contain_file('php.conf').with_content(/fqdn: rspec.example42.com/) } end describe 'Test Puppi Integration' do let(:params) { {:puppi => true, :puppi_helper => "myhelper"} } - it 'should generate a puppi::ze define' do - content = catalogue.resource('puppi::ze', 'php').send(:parameters)[:helper] - content.should == "myhelper" - end + it { should contain_puppi__ze('php').with_helper('myhelper') } end