summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-07-20 23:25:41 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-07-21 00:26:48 -0600
commit1c8ea7eeb2bfebdf294dd3e48d8a048f73986ee2 (patch)
tree0b5db4b2f985f91a1fa7088d0c50dbbf72fffe99
parent01b46b84acf2fe680d9dcd64b5cda70c327488e4 (diff)
test that converter emits warning if image cannot be embedded in running content
-rw-r--r--spec/running_content_spec.rb14
1 files changed, 14 insertions, 0 deletions
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