|
149 | 149 | ) } |
150 | 150 | end |
151 | 151 |
|
| 152 | + describe "Check default type" do |
| 153 | + context "with Apache version < 2.4" do |
| 154 | + let :params do |
| 155 | + { |
| 156 | + :apache_version => '2.2', |
| 157 | + } |
| 158 | + end |
| 159 | + |
| 160 | + context "when default_type => 'none'" do |
| 161 | + let :params do |
| 162 | + { :default_type => 'none' } |
| 163 | + end |
| 164 | + |
| 165 | + it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^DefaultType none$} } |
| 166 | + end |
| 167 | + context "when default_type => 'text/plain'" do |
| 168 | + let :params do |
| 169 | + { :default_type => 'text/plain' } |
| 170 | + end |
| 171 | + |
| 172 | + it { is_expected.to contain_file("/etc/apache2/apache2.conf").with_content %r{^DefaultType text/plain$} } |
| 173 | + end |
| 174 | + end |
| 175 | + |
| 176 | + context "with Apache version >= 2.4" do |
| 177 | + let :params do |
| 178 | + { |
| 179 | + :apache_version => '2.4', |
| 180 | + } |
| 181 | + end |
| 182 | + it { is_expected.to contain_file("/etc/apache2/apache2.conf").without_content %r{^DefaultType [.]*$} } |
| 183 | + end |
| 184 | + end |
| 185 | + |
152 | 186 | describe "Don't create user resource" do |
153 | 187 | context "when parameter manage_user is false" do |
154 | 188 | let :params do |
|
353 | 387 | it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^AddDefaultCharset none$} } |
354 | 388 | end |
355 | 389 |
|
| 390 | + context "with Apache version < 2.4" do |
| 391 | + let :params do |
| 392 | + { |
| 393 | + :apache_version => '2.2', |
| 394 | + } |
| 395 | + end |
| 396 | + |
| 397 | + context "when default_type => 'none'" do |
| 398 | + let :params do |
| 399 | + { :default_type => 'none' } |
| 400 | + end |
| 401 | + |
| 402 | + it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^DefaultType none$} } |
| 403 | + end |
| 404 | + context "when default_type => 'text/plain'" do |
| 405 | + let :params do |
| 406 | + { :default_type => 'text/plain' } |
| 407 | + end |
| 408 | + |
| 409 | + it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^DefaultType text/plain$} } |
| 410 | + end |
| 411 | + end |
| 412 | + |
| 413 | + context "with Apache version >= 2.4" do |
| 414 | + let :params do |
| 415 | + { |
| 416 | + :apache_version => '2.4', |
| 417 | + } |
| 418 | + end |
| 419 | + it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").without_content %r{^DefaultType [.]*$} } |
| 420 | + end |
| 421 | + |
356 | 422 | it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/site\.d/\*"$} } |
357 | 423 | it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.conf"$} } |
358 | 424 | it { is_expected.to contain_file("/etc/httpd/conf/httpd.conf").with_content %r{^Include "/etc/httpd/mod\.d/\*\.load"$} } |
|
0 commit comments