X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fwarnings_spec.rb;h=76e69d4bccf880e133b213952ba1c68dd0abd28f;hp=c3f76bf286fcc5e4d003afdfcfa98620af26c69c;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb b/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb index c3f76bf28..76e69d4bc 100644 --- a/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb +++ b/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb @@ -1,29 +1,26 @@ require 'spec_helper_acceptance' describe 'warnings' do - basedir = default.tmpdir('concat') - - shared_examples 'has_warning' do |pp, w| - it 'applies the manifest twice with a stderr regex' do - expect(apply_manifest(pp, :catch_failures => true).stderr).to match(/#{Regexp.escape(w)}/m) - expect(apply_manifest(pp, :catch_changes => true).stderr).to match(/#{Regexp.escape(w)}/m) - end + before(:all) do + @basedir = setup_test_directory end - context 'concat::fragment target not found' do - context 'target not found' do - pp = <<-EOS + context 'when concat::fragment target not found' do + let(:pp) do + <<-MANIFEST concat { 'file': - path => '#{basedir}/file', + path => '#{@basedir}/file', } concat::fragment { 'foo': - target => '#{basedir}/bar', + target => '#{@basedir}/bar', content => 'bar', } - EOS - w = 'not found in the catalog' + MANIFEST + end - it_behaves_like 'has_warning', pp, w + it 'applies manifests, check stderr' do + expect(apply_manifest(pp, expect_failures: true).stderr).to match 'not found in the catalog' + expect(apply_manifest(pp, expect_failures: true).stderr).to match 'not found in the catalog' end end end