]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/acceptance/mod_deflate_spec.rb
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / spec / acceptance / mod_deflate_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'apache::mod::deflate class' do
4   case fact('osfamily')
5   when 'Debian'
6     mod_dir      = '/etc/apache2/mods-available'
7     service_name = 'apache2'
8   when 'RedHat'
9     mod_dir      = '/etc/httpd/conf.d'
10     service_name = 'httpd'
11   when 'FreeBSD'
12     mod_dir      = '/usr/local/etc/apache24/Modules'
13     service_name = 'apache24'
14   when 'Gentoo'
15     mod_dir      = '/etc/apache2/modules.d'
16     service_name = 'apache2'
17   end
18
19   context "default deflate config" do
20     it 'succeeds in puppeting deflate' do
21       pp= <<-EOS
22         class { 'apache': }
23         include apache::mod::deflate
24       EOS
25       apply_manifest(pp, :catch_failures => true)
26     end
27
28     describe service(service_name) do
29       it { is_expected.to be_enabled }
30       it { is_expected.to be_running }
31     end
32
33     describe file("#{mod_dir}/deflate.conf") do
34       it { is_expected.to contain "AddOutputFilterByType DEFLATE text/html text/plain text/xml" }
35       it { is_expected.to contain "AddOutputFilterByType DEFLATE text/css" }
36       it { is_expected.to contain "AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript" }
37       it { is_expected.to contain "AddOutputFilterByType DEFLATE application/rss+xml" }
38       it { is_expected.to contain "DeflateFilterNote Input instream" }
39       it { is_expected.to contain "DeflateFilterNote Output outstream" }
40       it { is_expected.to contain "DeflateFilterNote Ratio ratio" }
41     end
42   end
43 end