]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/classes/mod/negotiation_spec.rb
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / spec / classes / mod / negotiation_spec.rb
1 require 'spec_helper'
2
3 describe 'apache::mod::negotiation', :type => :class do
4   describe "OS independent tests" do
5
6     let :facts do
7       {
8         :osfamily               => 'Debian',
9         :operatingsystem        => 'Debian',
10         :kernel                 => 'Linux',
11         :lsbdistcodename        => 'squeeze',
12         :operatingsystemrelease => '6',
13         :concat_basedir         => '/dne',
14         :id                     => 'root',
15         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
16         :is_pe                  => false,
17       }
18     end
19
20     context "default params" do
21       let :pre_condition do
22         'class {"::apache": }'
23       end
24       it { should contain_class("apache") }
25       it do
26         should contain_file('negotiation.conf').with( {
27           :ensure  => 'file',
28           :content => 'LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW
29 ForceLanguagePriority Prefer Fallback
30 ',
31         } )
32       end
33     end
34
35     context 'with force_language_priority parameter' do
36       let :pre_condition do
37         'class {"::apache": default_mods => ["negotiation"]}'
38       end
39       let :params do
40         { :force_language_priority => 'Prefer' }
41       end
42       it do
43         should contain_file('negotiation.conf').with( {
44           :ensure  => 'file',
45           :content => /^ForceLanguagePriority Prefer$/,
46         } )
47       end
48     end
49
50     context 'with language_priority parameter' do
51       let :pre_condition do
52         'class {"::apache": default_mods => ["negotiation"]}'
53       end
54       let :params do
55         { :language_priority => [ 'en', 'es' ] }
56       end
57       it do
58         should contain_file('negotiation.conf').with( {
59           :ensure  => 'file',
60           :content => /^LanguagePriority en es$/,
61         } )
62       end
63     end
64   end
65 end