X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fvalidation_spec.rb;h=7a3641a71344086c650a3f09145911022cdc6e80;hp=c35871b9b5145ec2c21030dd76c51e36cefff178;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/concat/spec/acceptance/validation_spec.rb b/3rdparty/modules/concat/spec/acceptance/validation_spec.rb index c35871b9b..7a3641a71 100644 --- a/3rdparty/modules/concat/spec/acceptance/validation_spec.rb +++ b/3rdparty/modules/concat/spec/acceptance/validation_spec.rb @@ -1,35 +1,27 @@ require 'spec_helper_acceptance' -describe 'concat validate_cmd parameter', :unless => (fact('kernel') != 'Linux') do - basedir = default.tmpdir('concat') - context '=> "/usr/bin/test -e %"' do - before(:all) do - pp = <<-EOS - file { '#{basedir}': - ensure => directory - } - EOS +describe 'validation, concat validate_cmd parameter', if: ['debian', 'redhat', 'ubuntu'].include?(os[:family]) do + before(:all) do + @basedir = setup_test_directory + end - apply_manifest(pp) - end - pp = <<-EOS - concat { '#{basedir}/file': + context 'with "/usr/bin/test -e %"' do + let(:pp) do + <<-MANIFEST + concat { '#{@basedir}/file': validate_cmd => '/usr/bin/test -e %', } concat::fragment { 'content': - target => '#{basedir}/file', + 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) + MANIFEST end - describe file("#{basedir}/file") do - it { should be_file } - it { should contain 'content' } + it 'applies the manifest twice with no stderr' do + idempotent_apply(pp) + expect(file("#{@basedir}/file")).to be_file + expect(file("#{@basedir}/file").content).to contain 'content' end end end