1 require 'spec_helper_acceptance'
3 describe 'concat warn_header =>' do
5 @basedir = setup_test_directory
8 describe 'applies the manifest twice with no stderr' do
11 concat { '#{@basedir}/file':
15 concat::fragment { '1':
16 target => '#{@basedir}/file',
21 concat::fragment { '2':
22 target => '#{@basedir}/file',
27 concat { '#{@basedir}/file2':
31 concat::fragment { 'file2_1':
32 target => '#{@basedir}/file2',
37 concat::fragment { 'file2_2':
38 target => '#{@basedir}/file2',
43 concat { '#{@basedir}/file3':
47 concat::fragment { 'file3_1':
48 target => '#{@basedir}/file3',
53 concat::fragment { 'file3_2':
54 target => '#{@basedir}/file3',
62 it 'when true should enable default warning message' do
64 expect(file("#{@basedir}/file")).to be_file
65 expect(file("#{@basedir}/file").content).to match %r{# This file is managed by Puppet\. DO NOT EDIT\.}
66 expect(file("#{@basedir}/file").content).to match %r{1}
67 expect(file("#{@basedir}/file").content).to match %r{2}
70 it 'when false should not enable default warning message' do
71 expect(file("#{@basedir}/file2")).to be_file
72 expect(file("#{@basedir}/file2").content).not_to match %r{# This file is managed by Puppet\. DO NOT EDIT\.}
73 expect(file("#{@basedir}/file2").content).to match %r{1}
74 expect(file("#{@basedir}/file2").content).to match %r{2}
77 it 'when foo should overide default warning message' do
78 expect(file("#{@basedir}/file3")).to be_file
79 expect(file("#{@basedir}/file3").content).to match %r{# foo}
80 expect(file("#{@basedir}/file3").content).to match %r{1}
81 expect(file("#{@basedir}/file3").content).to match %r{2}