summaryrefslogtreecommitdiff
path: root/spec/page_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2020-09-25 23:52:19 -0600
committerDan Allen <dan.j.allen@gmail.com>2020-09-26 01:27:41 -0600
commit5e126771a5727146a7dece64131e08c13eec8652 (patch)
treeea6cabcc67d758fa6dd2306c7bc7effa3188a812 /spec/page_spec.rb
parentf9778041c04a26005e6769ea709e16ccec135635 (diff)
verify converter shows warning if background image cannot be found
Diffstat (limited to 'spec/page_spec.rb')
-rw-r--r--spec/page_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/page_spec.rb b/spec/page_spec.rb
index 66cb04ed..e1871c1c 100644
--- a/spec/page_spec.rb
+++ b/spec/page_spec.rb
@@ -1051,6 +1051,18 @@ describe 'Asciidoctor::PDF::Converter - Page' do
ensure
File.unlink dest_file
end
+
+ it 'should warn instead of crash if image is unreadable' do
+ (expect do
+ pdf = to_pdf <<~'EOS', analyze: :image
+ = Document Title
+ :page-background-image: image:does-not-exist.png[fit=cover]
+
+ content
+ EOS
+ (expect pdf.images).to be_empty
+ end).to log_message severity: :WARN, message: '~page background image not found or readable'
+ end
end
context 'Watermark' do