forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add acceptance test for validate_cmd parameter.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require 'spec_helper_acceptance' | ||
|
||
describe 'concat validate_cmd parameter' do | ||
basedir = default.tmpdir('concat') | ||
context '=> "/usr/bin/test -e %"' do | ||
before(:all) do | ||
pp = <<-EOS | ||
file { '#{basedir}': | ||
ensure => directory | ||
} | ||
EOS | ||
|
||
apply_manifest(pp) | ||
end | ||
pp = <<-EOS | ||
concat { '#{basedir}/file': | ||
validate_cmd => '/usr/bin/test -e %', | ||
} | ||
concat::fragment { 'content': | ||
target => '#{basedir}/file', | ||
content => 'content', | ||
} | ||
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 } | ||
it { should contain 'content' } | ||
end | ||
end | ||
end |