]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/apache/spec/acceptance/custom_config_spec.rb
add Openstack modules to 3rdparty
[dsa-puppet.git] / 3rdparty / modules / apache / spec / acceptance / custom_config_spec.rb
1 require 'spec_helper_acceptance'
2 require_relative './version.rb'
3
4 describe 'apache::custom_config define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
5   context 'invalid config' do
6     it 'should not add the config' do
7       pp = <<-EOS
8         class { 'apache': }
9         apache::custom_config { 'acceptance_test':
10           content => 'INVALID',
11         }
12       EOS
13
14       apply_manifest(pp, :expect_failures => true)
15     end
16
17     describe file("#{$confd_dir}/25-acceptance_test.conf") do
18       it { is_expected.not_to be_file }
19     end
20   end
21
22   context 'valid config' do
23     it 'should add the config' do
24       pp = <<-EOS
25         class { 'apache': }
26         apache::custom_config { 'acceptance_test':
27           content => '# just a comment',
28         }
29       EOS
30
31       apply_manifest(pp, :catch_failures => true)
32     end
33
34     describe file("#{$confd_dir}/25-acceptance_test.conf") do
35       it { is_expected.to contain '# just a comment' }
36     end
37   end
38
39   describe 'custom_config without priority prefix' do
40     it 'applies cleanly' do
41       pp = <<-EOS
42         class { 'apache': }
43         apache::custom_config { 'prefix_test':
44           priority => false,
45           content => '# just a comment',
46         }
47       EOS
48       apply_manifest(pp, :catch_failures => true)
49     end
50
51     describe file("#{$confd_dir}/prefix_test.conf") do
52       it { is_expected.to be_file }
53     end
54   end
55 end