File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ def render_if_needed(element)
9494 end
9595
9696 def apply_tag_close_styles ( element )
97- tag_styles = element . tag_close_styles
97+ tag_styles = element . tag_closing
9898 @last_margin = tag_styles [ :margin_bottom ] . to_f
9999 pdf . advance_cursor ( last_margin + tag_styles [ :padding_bottom ] . to_f )
100100 pdf . start_new_page if tag_styles [ :break_after ]
101101 end
102102
103103 def apply_tag_open_styles ( element )
104- tag_styles = element . tag_open_styles
104+ tag_styles = element . tag_opening
105105 move_down = ( tag_styles [ :margin_top ] . to_f - last_margin ) + tag_styles [ :padding_top ] . to_f
106106 pdf . advance_cursor ( move_down ) if move_down > 0
107107 pdf . start_new_page if tag_styles [ :break_before ]
Original file line number Diff line number Diff line change @@ -56,14 +56,14 @@ def process_styles(element_styles: nil)
5656 # Styles to apply on tag closing
5757 #
5858 # @return [Hash] hash of styles to apply
59- def tag_close_styles
59+ def tag_closing
6060 styles . slice ( *Attributes ::STYLES_APPLY [ :tag_close ] )
6161 end
6262
6363 # Styles to apply on tag opening
6464 #
6565 # @return [Hash] hash of styles to apply
66- def tag_open_styles
66+ def tag_opening
6767 styles . slice ( *Attributes ::STYLES_APPLY [ :tag_open ] )
6868 end
6969
Original file line number Diff line number Diff line change 1818
1919 before do
2020 allow ( context ) . to receive ( :remove_last )
21- allow ( element ) . to receive ( :tag_close_styles ) . and_call_original
21+ allow ( element ) . to receive ( :tag_closing ) . and_call_original
2222 end
2323
2424 it 'handles tag closing' , :aggregate_failures do
2525 on_tag_close
26- expect ( element ) . to have_received ( :tag_close_styles )
26+ expect ( element ) . to have_received ( :tag_closing )
2727 expect ( context ) . to have_received ( :remove_last )
2828 end
2929 end
Original file line number Diff line number Diff line change @@ -94,14 +94,14 @@ def tag_styles
9494 it { is_expected . to eq ( color : '0088ff' ) }
9595 end
9696
97- describe '#tag_close_styles ' do
98- subject ( :tag_close_styles ) { tag . tag_close_styles }
97+ describe '#tag_closing ' do
98+ subject ( :tag_closing ) { tag . tag_closing }
9999
100100 it { is_expected . to eq ( { } ) }
101101 end
102102
103- describe '#tag_open_styles ' do
104- subject ( :tag_open_styles ) { tag . tag_open_styles }
103+ describe '#tag_opening ' do
104+ subject ( :tag_opening ) { tag . tag_opening }
105105
106106 it { is_expected . to eq ( { } ) }
107107 end
You can’t perform that action at this time.
0 commit comments