fuel-library/deployment/puppet/concat/spec/acceptance/newline_spec.rb
Bartłomiej Piotrowski bcc88b940a Merge puppetlabs/concat 1.2.3
While 2.x has been already released, it will most likely break our
manifests in subtle ways[1]. The fix is scheduled for Puppet 5.0[2].

[1] https://tickets.puppetlabs.com/browse/MODULES-2104
[2] https://tickets.puppetlabs.com/browse/PUP-1963

Commit: 5997e65f18eb78cd7dbce818eb29354e49d5a038
Source: https://github.com/puppetlabs/puppetlabs-concat/

Implements: blueprint upgrade-openstack-puppet-modules
Change-Id: Idc9bb8647d311f797ef7d3ae5a95d0b90ad00ad1
2015-06-15 10:29:06 +00:00

68 lines
1.5 KiB
Ruby

require 'spec_helper_acceptance'
describe 'concat ensure_newline parameter' do
basedir = default.tmpdir('concat')
context '=> false' do
before(:all) do
pp = <<-EOS
file { '#{basedir}':
ensure => directory
}
EOS
apply_manifest(pp)
end
pp = <<-EOS
concat { '#{basedir}/file':
ensure_newline => false,
}
concat::fragment { '1':
target => '#{basedir}/file',
content => '1',
}
concat::fragment { '2':
target => '#{basedir}/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file("#{basedir}/file") do
it { should be_file }
its(:content) { should match '12' }
end
end
context '=> true' do
pp = <<-EOS
concat { '#{basedir}/file':
ensure_newline => true,
}
concat::fragment { '1':
target => '#{basedir}/file',
content => '1',
}
concat::fragment { '2':
target => '#{basedir}/file',
content => '2',
}
EOS
it 'applies the manifest twice with no stderr' do
apply_manifest(pp, :catch_failures => true)
apply_manifest(pp, :catch_changes => true)
end
describe file("#{basedir}/file") do
it { should be_file }
its(:content) {
should match /1\n2\n/
}
end
end
end