Merge pull request #103 from jhoblitt/fragment_source
allow source param to concat::fragment to be a string or an Array
This commit is contained in:
commit
5b9ed7093a
2 changed files with 5 additions and 3 deletions
|
@ -38,7 +38,9 @@ define concat::fragment(
|
|||
validate_string($target)
|
||||
validate_re($ensure, '^$|^present$|^absent$|^file$|^directory$')
|
||||
validate_string($content)
|
||||
validate_string($source)
|
||||
if !(is_string($source) or is_array($source)) {
|
||||
fail('$source is not a string or an Array.')
|
||||
}
|
||||
validate_string($order)
|
||||
if $mode {
|
||||
warning('The $mode parameter to concat::fragment is deprecated and has no effect')
|
||||
|
|
|
@ -111,7 +111,7 @@ describe 'concat::fragment', :type => :define do
|
|||
end # content =>
|
||||
|
||||
context 'source =>' do
|
||||
['', '/foo/bar'].each do |source|
|
||||
['', '/foo/bar', ['/foo/bar', '/foo/baz']].each do |source|
|
||||
context source do
|
||||
it_behaves_like 'fragment', 'motd_header', {
|
||||
:source => source,
|
||||
|
@ -126,7 +126,7 @@ describe 'concat::fragment', :type => :define do
|
|||
let(:params) {{ :source => false, :target => '/etc/motd' }}
|
||||
|
||||
it 'should fail' do
|
||||
expect { should }.to raise_error(Puppet::Error, /is not a string/)
|
||||
expect { should }.to raise_error(Puppet::Error, /is not a string or an Array/)
|
||||
end
|
||||
end
|
||||
end # source =>
|
||||
|
|
Loading…
Reference in a new issue