forked from puppetlabs/puppetlabs-apache
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_config_spec.rb
More file actions
38 lines (32 loc) · 980 Bytes
/
Copy pathcustom_config_spec.rb
File metadata and controls
38 lines (32 loc) · 980 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'spec_helper_acceptance'
require_relative './version.rb'
describe 'apache::custom_config define', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
context 'invalid config' do
it 'should not add the config' do
pp = <<-EOS
class { 'apache': }
apache::custom_config { 'acceptance_test':
content => 'INVALID',
}
EOS
apply_manifest(pp, :expect_failures => true)
end
describe file("#{$confd_dir}/25-acceptance_test.conf") do
it { is_expected.not_to be_file }
end
end
context 'valid config' do
it 'should add the config' do
pp = <<-EOS
class { 'apache': }
apache::custom_config { 'acceptance_test':
content => '# just a comment',
}
EOS
apply_manifest(pp, :catch_failures => true)
end
describe file("#{$confd_dir}/25-acceptance_test.conf") do
it { is_expected.to contain '# just a comment' }
end
end
end