X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fquoted_paths_spec.rb;h=e331c08f8b25af5e8dbf60a0dfa834408ab9952b;hp=6f9f9fd5f624fa1328008d272d1d000bd47fd817;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/concat/spec/acceptance/quoted_paths_spec.rb b/3rdparty/modules/concat/spec/acceptance/quoted_paths_spec.rb index 6f9f9fd5f..e331c08f8 100644 --- a/3rdparty/modules/concat/spec/acceptance/quoted_paths_spec.rb +++ b/3rdparty/modules/concat/spec/acceptance/quoted_paths_spec.rb @@ -1,42 +1,33 @@ require 'spec_helper_acceptance' describe 'quoted paths' do - basedir = default.tmpdir('concat') - before(:all) do - pp = <<-EOS - file { '#{basedir}': - ensure => directory, - } - file { '#{basedir}/concat test': - ensure => directory, - } - EOS - apply_manifest(pp) + @basedir = setup_test_directory end - context 'path with blanks' do - pp = <<-EOS - concat { '#{basedir}/concat test/foo': - } - concat::fragment { '1': - target => '#{basedir}/concat test/foo', - content => 'string1', - } - concat::fragment { '2': - target => '#{basedir}/concat test/foo', - content => 'string2', - } - EOS - - it 'applies the manifest twice with no stderr' do - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) + describe 'with path with blanks' do + let(:pp) do + <<-MANIFEST + file { '#{@basedir}/concat test': + ensure => directory, + } + concat { '#{@basedir}/concat test/foo': + } + concat::fragment { '1': + target => '#{@basedir}/concat test/foo', + content => 'string1', + } + concat::fragment { '2': + target => '#{@basedir}/concat test/foo', + content => 'string2', + } + MANIFEST end - describe file("#{basedir}/concat test/foo") do - it { should be_file } - its(:content) { should match /string1string2/ } + it 'applies the manifest twice with no stderr' do + idempotent_apply(pp) + expect(file("#{@basedir}/concat test/foo")).to be_file + expect(file("#{@basedir}/concat test/foo").content).to match %r{string1string2} end end end