]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/classes/mod/alias_spec.rb
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / apache / spec / classes / mod / alias_spec.rb
1 require 'spec_helper'
2
3 describe 'apache::mod::alias', :type => :class do
4   let :pre_condition do
5     'include apache'
6   end
7   context "on a Debian OS", :compile do
8     let :facts do
9       {
10         :id                     => 'root',
11         :kernel                 => 'Linux',
12         :lsbdistcodename        => 'squeeze',
13         :osfamily               => 'Debian',
14         :operatingsystem        => 'Debian',
15         :operatingsystemrelease => '6',
16         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
17         :concat_basedir         => '/dne',
18         :is_pe                  => false,
19       }
20     end
21     it { is_expected.to contain_apache__mod("alias") }
22     it { is_expected.to contain_file("alias.conf").with(:content => /Alias \/icons\/ "\/usr\/share\/apache2\/icons\/"/) }
23   end
24   context "on a RedHat 6-based OS", :compile do
25     let :facts do
26       {
27         :id                     => 'root',
28         :kernel                 => 'Linux',
29         :osfamily               => 'RedHat',
30         :operatingsystem        => 'RedHat',
31         :operatingsystemrelease => '6',
32         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
33         :concat_basedir         => '/dne',
34         :is_pe                  => false,
35       }
36     end
37     it { is_expected.to contain_apache__mod("alias") }
38     it { is_expected.to contain_file("alias.conf").with(:content => /Alias \/icons\/ "\/var\/www\/icons\/"/) }
39   end
40   context "on a RedHat 7-based OS", :compile do
41     let :facts do
42       {
43         :id                     => 'root',
44         :kernel                 => 'Linux',
45         :osfamily               => 'RedHat',
46         :operatingsystem        => 'RedHat',
47         :operatingsystemrelease => '7',
48         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
49         :concat_basedir         => '/dne',
50         :is_pe                  => false,
51       }
52     end
53     it { is_expected.to contain_apache__mod("alias") }
54     it { is_expected.to contain_file("alias.conf").with(:content => /Alias \/icons\/ "\/usr\/share\/httpd\/icons\/"/) }
55   end
56   context "with icons options", :compile do
57     let :pre_condition do
58       'class { apache: default_mods => false }'
59     end
60     let :facts do
61       {
62         :id                     => 'root',
63         :kernel                 => 'Linux',
64         :osfamily               => 'RedHat',
65         :operatingsystem        => 'RedHat',
66         :operatingsystemrelease => '7',
67         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
68         :concat_basedir         => '/dne',
69         :is_pe                  => false,
70       }
71     end
72     let :params do
73       {
74         'icons_options' => 'foo'
75       }
76     end
77     it { is_expected.to contain_apache__mod("alias") }
78     it { is_expected.to contain_file("alias.conf").with(:content => /Options foo/) }
79   end
80   context "on a FreeBSD OS", :compile do
81     let :facts do
82       {
83         :id                     => 'root',
84         :kernel                 => 'FreeBSD',
85         :osfamily               => 'FreeBSD',
86         :operatingsystem        => 'FreeBSD',
87         :operatingsystemrelease => '10',
88         :path                   => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
89         :concat_basedir         => '/dne',
90         :is_pe                  => false,
91       }
92     end
93     it { is_expected.to contain_apache__mod("alias") }
94     it { is_expected.to contain_file("alias.conf").with(:content => /Alias \/icons\/ "\/usr\/local\/www\/apache24\/icons\/"/) }
95   end
96 end