]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/spec/acceptance/warn_spec.rb
try if downgrading to 1.2.2 solves my problem
[dsa-puppet.git] / 3rdparty / modules / concat / spec / acceptance / warn_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'concat warn =>' do
4   basedir = default.tmpdir('concat')
5   context 'true should enable default warning message' do
6     pp = <<-EOS
7       concat { '#{basedir}/file':
8         warn  => true,
9       }
10
11       concat::fragment { '1':
12         target  => '#{basedir}/file',
13         content => '1',
14         order   => '01',
15       }
16
17       concat::fragment { '2':
18         target  => '#{basedir}/file',
19         content => '2',
20         order   => '02',
21       }
22     EOS
23
24     it 'applies the manifest twice with no stderr' do
25       apply_manifest(pp, :catch_failures => true)
26       apply_manifest(pp, :catch_changes => true)
27     end
28
29     describe file("#{basedir}/file") do
30       it { should be_file }
31       its(:content) {
32         should match /# This file is managed by Puppet\. DO NOT EDIT\./
33         should match /1/
34         should match /2/
35       }
36     end
37   end
38   context 'false should not enable default warning message' do
39     pp = <<-EOS
40       concat { '#{basedir}/file':
41         warn  => false,
42       }
43
44       concat::fragment { '1':
45         target  => '#{basedir}/file',
46         content => '1',
47         order   => '01',
48       }
49
50       concat::fragment { '2':
51         target  => '#{basedir}/file',
52         content => '2',
53         order   => '02',
54       }
55     EOS
56
57     it 'applies the manifest twice with no stderr' do
58       apply_manifest(pp, :catch_failures => true)
59       apply_manifest(pp, :catch_changes => true)
60     end
61
62     describe file("#{basedir}/file") do
63       it { should be_file }
64       its(:content) {
65         should_not match /# This file is managed by Puppet\. DO NOT EDIT\./
66         should match /1/
67         should match /2/
68       }
69     end
70   end
71   context '# foo should overide default warning message' do
72     pp = <<-EOS
73       concat { '#{basedir}/file':
74         warn  => '# foo',
75       }
76
77       concat::fragment { '1':
78         target  => '#{basedir}/file',
79         content => '1',
80         order   => '01',
81       }
82
83       concat::fragment { '2':
84         target  => '#{basedir}/file',
85         content => '2',
86         order   => '02',
87       }
88     EOS
89
90     it 'applies the manifest twice with no stderr' do
91       apply_manifest(pp, :catch_failures => true)
92       apply_manifest(pp, :catch_changes => true)
93     end
94
95     describe file("#{basedir}/file") do
96       it { should be_file }
97       its(:content) {
98         should match /# foo/
99         should match /1/
100         should match /2/
101       }
102     end
103   end
104 end