Skip to content

Commit 3d78b74

Browse files
committed
spec for #merge start takes min starting block index
1 parent 666fae5 commit 3d78b74

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

spec/document/text_block_spec.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ module Boilerpipe
7575
subject.merge_next(another_block)
7676
expect(subject.num_wrapped_lines).to eq 2
7777
end
78+
79+
it 'offset_block_start uses the earlier start' do
80+
block = Document::TextBlock.new('one', 1, 1, 1, 1, 5)
81+
another_block = Document::TextBlock.new('two', 1, 1, 1, 1, 3)
82+
block.merge_next(another_block)
83+
expect(block.offset_blocks_start).to eq 3
84+
end
7885
end
7986

8087
describe '#add_label' do

0 commit comments

Comments
 (0)