From ad86699763fd9f723b41d302c29177027f02a684 Mon Sep 17 00:00:00 2001 From: Tomify Date: Thu, 13 Jan 2022 13:48:58 -0500 Subject: [PATCH] add test for #1121 --- spec/prawn/document_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/spec/prawn/document_spec.rb b/spec/prawn/document_spec.rb index 3b649629e..029c044c7 100644 --- a/spec/prawn/document_spec.rb +++ b/spec/prawn/document_spec.rb @@ -126,6 +126,19 @@ def self.format(string) expect(pdf.instance_variable_get(:@background)).to eq(filename) end end + + it 'retains the current margin and padding' do + initial_absolute_left = pdf.bounds.absolute_left + + pdf.bounding_box [0, pdf.cursor], width: pdf.bounds.width do + pdf.bounds.move_past_bottom + end + pdf.indent 20 do + pdf.bounds.move_past_bottom + end + + expect(pdf.bounds.absolute_left).to eq(initial_absolute_left) + end end describe '#float' do