summaryrefslogtreecommitdiff
path: root/spec/image_float_spec.rb
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-15 15:35:18 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-05-15 15:35:18 -0600
commitb524d0c046c57f62ec2c78a1eec4a79edfa9efc7 (patch)
tree8728bda7d834f377625ca98f3d41763fcd310c92 /spec/image_float_spec.rb
parentf8fa537b8763253b5b0f4ae2a9ea70c966baaa16 (diff)
add test to verify text formatting is applied to text that wraps around a float
Diffstat (limited to 'spec/image_float_spec.rb')
-rw-r--r--spec/image_float_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/image_float_spec.rb b/spec/image_float_spec.rb
index eed762b6..1ed291a8 100644
--- a/spec/image_float_spec.rb
+++ b/spec/image_float_spec.rb
@@ -406,6 +406,20 @@ describe 'Asciidoctor::PDF::Converter - Image Float' do
(expect text[:font_color]).to eql 'AA0000'
end
+ it 'should apply text formatting to wrapped text' do
+ input = <<~EOS
+ image::rect.png[pdfwidth=3in,float=left]
+
+ #{((lorem_ipsum '4-sentences-1-paragraph').sub 'Lorem', '*Lorem*').sub 'tempor', '_tempor_'}
+ EOS
+
+ pdf = to_pdf input, pdf_theme: pdf_theme, analyze: true
+ bold_text = pdf.find_text font_name: 'NotoSerif-Bold'
+ (expect bold_text).to have_size 1
+ italic_text = pdf.find_text font_name: 'NotoSerif-Italic'
+ (expect italic_text).to have_size 1
+ end
+
# TODO: could check that gap to next paragraph is correct
it 'should honor role that changes font size, font family, and line height on paragraph in float box' do
pdf_theme[:extends] = 'default-with-fallback-font'