From 8fb2dfd46c5a17a36bef16081b25ce4e401115b7 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Thu, 1 May 2014 17:04:09 -0700 Subject: [PATCH] Update specs --- manifests/mod/php.pp | 1 + spec/acceptance/mod_php_spec.rb | 8 +++++--- spec/classes/mod/php_spec.rb | 8 ++++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/manifests/mod/php.pp b/manifests/mod/php.pp index 2d954db5b..b797936bd 100644 --- a/manifests/mod/php.pp +++ b/manifests/mod/php.pp @@ -18,6 +18,7 @@ include ::apache::mod::dir Class['::apache::mod::mime'] -> Class['::apache::mod::dir'] -> Class['::apache::mod::php'] + # Template uses $extensions file { 'php5.conf': ensure => file, path => "${::apache::mod_dir}/php5.conf", diff --git a/spec/acceptance/mod_php_spec.rb b/spec/acceptance/mod_php_spec.rb index d1c991621..cf8054053 100644 --- a/spec/acceptance/mod_php_spec.rb +++ b/spec/acceptance/mod_php_spec.rb @@ -53,13 +53,15 @@ class { 'apache::mod::php': } end end - context "custom php admin_flag and php_admin_value" do + context "custom extensions, php_admin_flag, and php_admin_value" do it 'succeeds in puppeting php' do pp= <<-EOS class { 'apache': mpm_module => 'prefork', } - class { 'apache::mod::php': } + class { 'apache::mod::php': + extensions => ['.php','.php5'], + } apache::vhost { 'php.example.com': port => '80', docroot => '/var/www/php', @@ -67,7 +69,7 @@ class { 'apache::mod::php': } php_admin_flags => { 'engine' => 'on', }, } host { 'php.example.com': ip => '127.0.0.1', } - file { '/var/www/php/index.php': + file { '/var/www/php/index.php5': ensure => file, content => "\\n", } diff --git a/spec/classes/mod/php_spec.rb b/spec/classes/mod/php_spec.rb index 29adc870f..32b2ff099 100644 --- a/spec/classes/mod/php_spec.rb +++ b/spec/classes/mod/php_spec.rb @@ -64,6 +64,14 @@ :content => "LoadModule php5_module alternative-path\n" ) } end + context "with alternative extensions" do let :pre_condition do + 'class { "apache": }' + end + let :params do + { :extensions => ['.php','.php5']} + end + it { should contain_file("php5.conf").with_content =~ /AddHandler php5-script .php .php5\n/ } + end context "with specific version" do let :pre_condition do 'class { "apache": }'