From 1c8ea7eeb2bfebdf294dd3e48d8a048f73986ee2 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 20 Jul 2020 23:25:41 -0600 Subject: test that converter emits warning if image cannot be embedded in running content --- spec/running_content_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/running_content_spec.rb b/spec/running_content_spec.rb index 3cc7829f..11d278da 100644 --- a/spec/running_content_spec.rb +++ b/spec/running_content_spec.rb @@ -2219,6 +2219,20 @@ describe 'Asciidoctor::PDF::Converter - Running Content' do end end + it 'should warn if image cannot be embedded' do + pdf_theme = { + footer_font_color: '0000FF', + footer_columns: '=100%', + footer_recto_center_content: %(image:#{fixture_file 'broken.svg'}[]), + } + + (expect do + pdf = to_pdf 'body', analyze: true, pdf_theme: pdf_theme, enable_footer: true + footer_text = pdf.find_text font_color: '0000FF' + (expect footer_text).to be_empty + end).to log_message severity: :WARN, message: %(~could not embed image in running content: #{fixture_file 'broken.svg'}; Missing end tag for 'rect') + end + it 'should support data URI image', visual: true do image_data = File.binread fixture_file 'tux.png' encoded_image_data = Base64.strict_encode64 image_data -- cgit v1.2.3