validation_spec.rb 856 B

1234567891011121314151617181920212223242526272829303132333435
  1. require 'spec_helper_acceptance'
  2. describe 'concat validate_cmd parameter', :unless => (fact('kernel') != 'Linux') do
  3. basedir = default.tmpdir('concat')
  4. context '=> "/usr/bin/test -e %"' do
  5. before(:all) do
  6. pp = <<-EOS
  7. file { '#{basedir}':
  8. ensure => directory
  9. }
  10. EOS
  11. apply_manifest(pp)
  12. end
  13. pp = <<-EOS
  14. concat { '#{basedir}/file':
  15. validate_cmd => '/usr/bin/test -e %',
  16. }
  17. concat::fragment { 'content':
  18. target => '#{basedir}/file',
  19. content => 'content',
  20. }
  21. EOS
  22. it 'applies the manifest twice with no stderr' do
  23. apply_manifest(pp, :catch_failures => true)
  24. apply_manifest(pp, :catch_changes => true)
  25. end
  26. describe file("#{basedir}/file") do
  27. it { should be_file }
  28. it { should contain 'content' }
  29. end
  30. end
  31. end