Skip to content

Commit

Permalink
test merge cells
Browse files Browse the repository at this point in the history
  • Loading branch information
bprasetyo authored Nov 23, 2020
1 parent 475649c commit ed564a1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/xlsxtream/worksheet_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,25 @@ def test_respond_to_name
ws = Worksheet.new(StringIO.new, name: 'test')
assert_equal 'test', ws.name
end

def test_with_merge_cells
io = StringIO.new
ws = Worksheet.new(io)
ws << ['foo']
ws.add_row ['bar']
ws.merge_cells(['A1:B1', 'A2:B2'])
ws.close
expected = \
'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'"\r\n" \
'<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><sheetData>' \
'<row r="1"><c r="A1" t="inlineStr"><is><t>foo</t></is></c></row>' \
'<row r="2"><c r="A2" t="inlineStr"><is><t>bar</t></is></c></row>' \
'</sheetData>' \
'<mergeCells r="2">' \
'<mergeCell ref="A1:B1"/>' \
'<mergeCell ref="A2:B2"/>' \
'</mergeCells></worksheet>'
assert_equal expected, io.string
end
end
end

0 comments on commit ed564a1

Please sign in to comment.