2013-10-29 23:39:54 +01:00
|
|
|
require 'spec_helper_system'
|
|
|
|
|
|
|
|
describe 'deprecation warnings' do
|
|
|
|
|
|
|
|
shared_examples 'has_warning'do |pp, w|
|
|
|
|
context puppet_apply(pp) do
|
|
|
|
its(:stderr) { should =~ /#{Regexp.escape(w)}/m }
|
|
|
|
its(:exit_code) { should_not == 1 }
|
|
|
|
its(:refresh) { should be_nil }
|
|
|
|
its(:stderr) { should =~ /#{Regexp.escape(w)}/m }
|
|
|
|
its(:exit_code) { should be_zero }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'concat gnu parameter' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-11-06 04:40:03 +01:00
|
|
|
concat { '/tmp/concat/file':
|
2013-10-29 23:39:54 +01:00
|
|
|
gnu => 'foo',
|
|
|
|
}
|
|
|
|
concat::fragment { 'foo':
|
2013-11-06 04:40:03 +01:00
|
|
|
target => '/tmp/concat/file',
|
2013-10-29 23:39:54 +01:00
|
|
|
}
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-10-29 23:39:54 +01:00
|
|
|
w = 'The $gnu parameter to concat is deprecated and has no effect'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
2013-11-02 18:45:02 +01:00
|
|
|
context 'concat::fragment mode parameter' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-11-06 04:40:03 +01:00
|
|
|
concat { '/tmp/concat/file': }
|
2013-11-02 18:45:02 +01:00
|
|
|
concat::fragment { 'foo':
|
2013-11-06 04:40:03 +01:00
|
|
|
target => '/tmp/concat/file',
|
2013-11-02 18:45:02 +01:00
|
|
|
mode => 'bar',
|
|
|
|
}
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-11-02 18:45:02 +01:00
|
|
|
w = 'The $mode parameter to concat::fragment is deprecated and has no effect'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'concat::fragment owner parameter' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-11-06 04:40:03 +01:00
|
|
|
concat { '/tmp/concat/file': }
|
2013-11-02 18:45:02 +01:00
|
|
|
concat::fragment { 'foo':
|
2013-11-06 04:40:03 +01:00
|
|
|
target => '/tmp/concat/file',
|
2013-11-02 18:45:02 +01:00
|
|
|
owner => 'bar',
|
|
|
|
}
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-11-02 18:45:02 +01:00
|
|
|
w = 'The $owner parameter to concat::fragment is deprecated and has no effect'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'concat::fragment group parameter' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-11-06 04:40:03 +01:00
|
|
|
concat { '/tmp/concat/file': }
|
2013-11-02 18:45:02 +01:00
|
|
|
concat::fragment { 'foo':
|
2013-11-06 04:40:03 +01:00
|
|
|
target => '/tmp/concat/file',
|
2013-11-02 18:45:02 +01:00
|
|
|
group => 'bar',
|
|
|
|
}
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-11-02 18:45:02 +01:00
|
|
|
w = 'The $group parameter to concat::fragment is deprecated and has no effect'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
2013-10-29 23:39:54 +01:00
|
|
|
context 'concat::fragment backup parameter' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-11-06 04:40:03 +01:00
|
|
|
concat { '/tmp/concat/file': }
|
2013-10-29 23:39:54 +01:00
|
|
|
concat::fragment { 'foo':
|
2013-11-06 04:40:03 +01:00
|
|
|
target => '/tmp/concat/file',
|
2013-10-29 23:39:54 +01:00
|
|
|
backup => 'bar',
|
|
|
|
}
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-10-29 23:39:54 +01:00
|
|
|
w = 'The $backup parameter to concat::fragment is deprecated and has no effect'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'include concat::setup' do
|
2013-11-14 04:28:27 +01:00
|
|
|
pp = <<-EOS
|
2013-10-29 23:39:54 +01:00
|
|
|
include concat::setup
|
2013-11-14 04:28:27 +01:00
|
|
|
EOS
|
2013-10-29 23:39:54 +01:00
|
|
|
w = 'concat::setup is deprecated as a public API of the concat module and should no longer be directly included in the manifest.'
|
|
|
|
|
|
|
|
it_behaves_like 'has_warning', pp, w
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|