forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deprecation_warnings_spec.rb
44 lines (38 loc) · 1.17 KB
/
deprecation_warnings_spec.rb
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
39
40
41
42
43
44
require 'spec_helper_acceptance'
describe 'deprecation warnings' do
basedir = default.tmpdir('concat')
shared_examples 'has_warning' do |pp, w|
it 'applies the manifest twice with a stderr regex' do
expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m)
expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m)
end
end
context 'concat force parameter' do
pp = <<-EOS
concat { '#{basedir}/file':
force => false,
}
concat::fragment { 'foo':
target => '#{basedir}/file',
content => 'bar',
}
EOS
w = 'The $force parameter to concat is deprecated and has no effect.'
it_behaves_like 'has_warning', pp, w
end
context 'concat::fragment ensure parameter' do
context 'target file exists' do
pp = <<-EOS
concat { '#{basedir}/file':
}
concat::fragment { 'foo':
target => '#{basedir}/file',
ensure => false,
content => 'bar',
}
EOS
w = 'The $ensure parameter to concat::fragment is deprecated and has no effect.'
it_behaves_like 'has_warning', pp, w
end
end
end