diff options
| author | Jurriaan Pruis <[email protected]> | 2012-04-02 13:48:35 +0200 |
|---|---|---|
| committer | Jurriaan Pruis <[email protected]> | 2012-04-02 13:48:35 +0200 |
| commit | d2b1274f7bf6058e484158cfd78b4ba7212f91b2 (patch) | |
| tree | 2e92667265a39af6a5b1e8a5a4ac67b98616c5c3 /test/workbook/worksheet/tc_row.rb | |
| parent | 32c027461698a81142772d60f142996f2fa2e113 (diff) | |
| download | caxlsx-d2b1274f7bf6058e484158cfd78b4ba7212f91b2.tar.gz caxlsx-d2b1274f7bf6058e484158cfd78b4ba7212f91b2.zip | |
Updated tests for nil cells
Diffstat (limited to 'test/workbook/worksheet/tc_row.rb')
| -rw-r--r-- | test/workbook/worksheet/tc_row.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index d1507aa1..a953566e 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -27,6 +27,19 @@ class TestRow < Test::Unit::TestCase r.cells.each { |c| assert_equal(c.style,1) } end + def test_nil_cells + row = @ws.add_row([nil,1,2,nil,4,5,nil]) + r_s_xml = Nokogiri::XML(row.to_xml_string(0, '')) + assert_equal(r_s_xml.xpath(".//row/c").size, 4) + end + + def test_nil_cell_r + row = @ws.add_row([nil,1,2,nil,4,5,nil]) + r_s_xml = Nokogiri::XML(row.to_xml_string(0, '')) + assert_equal(r_s_xml.xpath(".//row/c").first['r'], 'B1') + assert_equal(r_s_xml.xpath(".//row/c").last['r'], 'F1') + end + def test_index assert_equal(@row.index, @row.worksheet.rows.index(@row)) end |
