Skip to content

Commit

Permalink
Update specs
Browse files Browse the repository at this point in the history
  • Loading branch information
hunner committed May 2, 2014
1 parent fc347a8 commit 8fb2dfd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions manifests/mod/php.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions spec/acceptance/mod_php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,23 @@ 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',
php_admin_values => { 'open_basedir' => '/var/www/php/:/usr/share/pear/', },
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 => "<?php phpinfo(); ?>\\n",
}
Expand Down
8 changes: 8 additions & 0 deletions spec/classes/mod/php_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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": }'
Expand Down

0 comments on commit 8fb2dfd

Please sign in to comment.