3 describe 'apache::mod::dir', :type => :class do
9 context "on a Debian OS" do
12 :osfamily => 'Debian',
13 :operatingsystemrelease => '6',
14 :concat_basedir => '/dne',
15 :operatingsystem => 'Debian',
18 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
19 :lsbdistcodename => 'squeeze',
23 context "passing no parameters" do
24 it { is_expected.to contain_class("apache::params") }
25 it { is_expected.to contain_apache__mod('dir') }
26 it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
27 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
28 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
29 it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
30 it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
31 it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
32 it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
34 context "passing indexes => ['example.txt','fearsome.aspx']" do
36 {:indexes => ['example.txt','fearsome.aspx']}
38 it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
39 it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
42 context "on a RedHat OS" do
45 :osfamily => 'RedHat',
46 :operatingsystemrelease => '6',
47 :concat_basedir => '/dne',
48 :operatingsystem => 'Redhat',
51 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
55 context "passing no parameters" do
56 it { is_expected.to contain_class("apache::params") }
57 it { is_expected.to contain_apache__mod('dir') }
58 it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
59 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
60 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
61 it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
62 it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
63 it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
64 it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
66 context "passing indexes => ['example.txt','fearsome.aspx']" do
68 {:indexes => ['example.txt','fearsome.aspx']}
70 it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
71 it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
74 context "on a FreeBSD OS" do
77 :osfamily => 'FreeBSD',
78 :operatingsystemrelease => '9',
79 :concat_basedir => '/dne',
80 :operatingsystem => 'FreeBSD',
83 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
87 context "passing no parameters" do
88 it { is_expected.to contain_class("apache::params") }
89 it { is_expected.to contain_apache__mod('dir') }
90 it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
91 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
92 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
93 it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
94 it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
95 it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
96 it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
98 context "passing indexes => ['example.txt','fearsome.aspx']" do
100 {:indexes => ['example.txt','fearsome.aspx']}
102 it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
103 it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }
106 context "on a Gentoo OS" do
109 :osfamily => 'Gentoo',
110 :operatingsystem => 'Gentoo',
111 :operatingsystemrelease => '3.16.1-gentoo',
112 :concat_basedir => '/dne',
115 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin',
119 context "passing no parameters" do
120 it { is_expected.to contain_class("apache::params") }
121 it { is_expected.to contain_apache__mod('dir') }
122 it { is_expected.to contain_file('dir.conf').with_content(/^DirectoryIndex /) }
123 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html /) }
124 it { is_expected.to contain_file('dir.conf').with_content(/ index\.html\.var /) }
125 it { is_expected.to contain_file('dir.conf').with_content(/ index\.cgi /) }
126 it { is_expected.to contain_file('dir.conf').with_content(/ index\.pl /) }
127 it { is_expected.to contain_file('dir.conf').with_content(/ index\.php /) }
128 it { is_expected.to contain_file('dir.conf').with_content(/ index\.xhtml$/) }
130 context "passing indexes => ['example.txt','fearsome.aspx']" do
132 {:indexes => ['example.txt','fearsome.aspx']}
134 it { is_expected.to contain_file('dir.conf').with_content(/ example\.txt /) }
135 it { is_expected.to contain_file('dir.conf').with_content(/ fearsome\.aspx$/) }