Skip to content
Browse files

Add spec tests for apache::vhost access_log

  • Loading branch information...
1 parent 7488739 commit d136df60246a653848735566856fef093791a2b5 @hunner committed
Showing with 22 additions and 8 deletions.
  1. +22 −8 spec/defines/vhost_spec.rb
View
30 spec/defines/vhost_spec.rb
@@ -29,14 +29,15 @@
end
[{
- :apache_name => 'httpd',
- :docroot => 'path/to/docroot',
- :override => ['Options', 'FileInfo'],
- :port => '80',
- :priority => '25',
- :serveradmin => 'serveradmin@puppet',
- :ssl => false,
- :template => 'apache/vhost-default.conf.erb',
+ :apache_name => 'httpd',
+ :docroot => 'path/to/docroot',
+ :override => ['Options', 'FileInfo'],
+ :port => '80',
+ :priority => '25',
+ :serveradmin => 'serveradmin@puppet',
+ :ssl => false,
+ :access_log => false,
+ :template => 'apache/vhost-default.conf.erb',
},
].each do |param_set|
@@ -80,5 +81,18 @@
end
end
+
+ [true,false].each do |value|
+ describe "when access_log is #{value}" do
+ let :params do
+ default_params.merge({:access_log => value})
+ end
+
+ it "#{value ? "should" : "should not"} contain access logs" do
+ lines = subject.resource('file', "#{params[:priority]}-#{title}.conf").send(:parameters)[:content].split("\n")
+ !!lines.grep('_access.log combined').should == value
+ end
+ end
+ end
end
end

0 comments on commit d136df6

Please sign in to comment.
Something went wrong with that request. Please try again.