]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/concat/spec/acceptance/deprecation_warnings_spec.rb
8a689a76b52e152539a930f87dd32d528425f702
[dsa-puppet.git] / 3rdparty / modules / concat / spec / acceptance / deprecation_warnings_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'deprecation warnings' do
4   basedir = default.tmpdir('concat')
5
6   shared_examples 'has_warning' do |pp, w|
7     it 'applies the manifest twice with a stderr regex' do
8       expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m)
9       expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m)
10     end
11   end
12
13   context 'concat force parameter' do
14     pp = <<-EOS
15       concat { '#{basedir}/file':
16         force => false,
17       }
18       concat::fragment { 'foo':
19         target  => '#{basedir}/file',
20         content => 'bar',
21       }
22     EOS
23     w = 'The $force parameter to concat is deprecated and has no effect.'
24
25     it_behaves_like 'has_warning', pp, w
26   end
27
28   context 'concat::fragment ensure parameter' do
29     context 'target file exists' do
30     pp = <<-EOS
31       concat { '#{basedir}/file':
32       }
33       concat::fragment { 'foo':
34         target  => '#{basedir}/file',
35         ensure  => false,
36         content => 'bar',
37       }
38     EOS
39     w = 'The $ensure parameter to concat::fragment is deprecated and has no effect.'
40
41     it_behaves_like 'has_warning', pp, w
42     end
43   end
44 end