7a3641a71344086c650a3f09145911022cdc6e80
[mirror/dsa-puppet.git] / 3rdparty / modules / concat / spec / acceptance / validation_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validation, concat validate_cmd parameter', if: ['debian', 'redhat', 'ubuntu'].include?(os[:family]) do
4   before(:all) do
5     @basedir = setup_test_directory
6   end
7
8   context 'with "/usr/bin/test -e %"' do
9     let(:pp) do
10       <<-MANIFEST
11       concat { '#{@basedir}/file':
12         validate_cmd => '/usr/bin/test -e %',
13       }
14       concat::fragment { 'content':
15         target  => '#{@basedir}/file',
16         content => 'content',
17       }
18       MANIFEST
19     end
20
21     it 'applies the manifest twice with no stderr' do
22       idempotent_apply(pp)
23       expect(file("#{@basedir}/file")).to be_file
24       expect(file("#{@basedir}/file").content).to contain 'content'
25     end
26   end
27 end