X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fwarnings_spec.rb;fp=3rdparty%2Fmodules%2Fconcat%2Fspec%2Facceptance%2Fwarnings_spec.rb;h=c3f76bf286fcc5e4d003afdfcfa98620af26c69c;hb=5e197fe72fe9bf4fa5a89ee513a3ffc1ea97c8d9;hp=0000000000000000000000000000000000000000;hpb=6963202b4b62c2816655ac9532521b018fdf83bd;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb b/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb new file mode 100644 index 000000000..c3f76bf28 --- /dev/null +++ b/3rdparty/modules/concat/spec/acceptance/warnings_spec.rb @@ -0,0 +1,29 @@ +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 + end + + context 'concat::fragment target not found' do + context 'target not found' do + pp = <<-EOS + concat { 'file': + path => '#{basedir}/file', + } + concat::fragment { 'foo': + target => '#{basedir}/bar', + content => 'bar', + } + EOS + w = 'not found in the catalog' + + it_behaves_like 'has_warning', pp, w + end + end +end