X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fconcurrency_spec.rb;h=49d39e42c7fef47296a99a787812c5fb08fb4fe8;hp=fcffdbd108f4be6cd3d1663f458a644df2006f9d;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb b/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb index fcffdbd10..49d39e42c 100644 --- a/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb +++ b/3rdparty/modules/concat/spec/acceptance/concurrency_spec.rb @@ -1,37 +1,35 @@ require 'spec_helper_acceptance' -describe 'with file recursive purge' do - basedir = default.tmpdir('concat') - context 'should still create concat file' do - pp = <<-EOS - file { '#{basedir}/bar': - ensure => directory, - purge => true, - recurse => true, - } +describe 'concurrency, with file recursive purge' do + before(:all) do + @basedir = setup_test_directory + end - concat { "foobar": - ensure => 'present', - path => '#{basedir}/bar/foobar', - } + describe 'when run should still create concat file' do + let(:pp) do + <<-MANIFEST + file { '#{@basedir}/bar': + ensure => directory, + purge => true, + recurse => true, + } - concat::fragment { 'foo': - target => 'foobar', - content => 'foo', - } - EOS + concat { "foobar": + ensure => 'present', + path => '#{@basedir}/bar/foobar', + } - it 'applies the manifest twice with no stderr' do - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) + concat::fragment { 'foo': + target => 'foobar', + content => 'foo', + } + MANIFEST end - describe file("#{basedir}/bar/foobar") do - it { should be_file } - its(:content) { - should match 'foo' - } + it 'applies the manifest twice with no stderr' do + idempotent_apply(pp) + expect(file("#{@basedir}/bar/foobar")).to be_file + expect(file("#{@basedir}/bar/foobar").content).to match 'foo' end end end -