diff options
| author | Dan Allen <dan.j.allen@gmail.com> | 2019-09-01 23:59:30 -0600 |
|---|---|---|
| committer | Dan Allen <dan.j.allen@gmail.com> | 2019-09-02 00:59:51 -0600 |
| commit | ceb27aebf98692eac692f1e360fbf7a3973a23e6 (patch) | |
| tree | cdc44a3e26d04fbb7fca0374f59a3ceb66cb0369 | |
| parent | 3c926e1dee162b16bedfcc91b8ebaf52cbbb7eb3 (diff) | |
verify converter uses image format specified by format attribute
| -rw-r--r-- | spec/image_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/image_spec.rb b/spec/image_spec.rb index 2e9c47b4..bbf38844 100644 --- a/spec/image_spec.rb +++ b/spec/image_spec.rb @@ -334,6 +334,20 @@ describe 'Asciidoctor::PDF::Converter - Image' do (expect images).to have_size 1 (expect (pdf.page 1).text).to be_empty end + + it 'should use image format specified by format attribute' do + pdf = to_pdf <<~'EOS', attribute_overrides: { 'allow-uri-read' => '' }, analyze: :rect + :pdf-page-size: 200x400 + :pdf-page-margin: 0 + + image::https://raw.githubusercontent.com/asciidoctor/asciidoctor-pdf/master/spec/fixtures/square.svg?v=1[format=svg,pdfwidth=100%] + EOS + (expect pdf.rectangles).to have_size 1 + rect = pdf.rectangles[0] + (expect rect[:point]).to eql [0.0, 200.0] + (expect rect[:width]).to eql 200.0 + (expect rect[:height]).to eql 200.0 + end end context 'Link' do |
