Skip to content

Commit

Permalink
read intrinsic width of generated diagram image from cache data
Browse files Browse the repository at this point in the history
  • Loading branch information
mojavelinux committed Jan 8, 2025
1 parent b154248 commit 789863a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion spec/diagram_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
(expect Pathname.new output_file 'images/pdfwidth-test.png').to exist
images = pdf.images
(expect images).to have_size 1
(expect images[0][:intrinsic_width].to_f).to eql 288.0
image_data = JSON.load_file Pathname.new output_file '.asciidoctor/diagram/pdfwidth-test.png.cache'
(expect images[0][:intrinsic_width].to_f).to eql image_data['width'].to_f
(expect images[0][:width].to_f).to eql 72.0
end

Expand Down

0 comments on commit 789863a

Please sign in to comment.