diff options
| author | Randy Morgan <[email protected]> | 2012-05-09 08:21:39 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-05-09 08:21:39 +0900 |
| commit | ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285 (patch) | |
| tree | 4552debc0d77b4e84b027b6be8fe90c8f17dc6bc /test/workbook | |
| parent | 7aa25770f1d92a2b4aa2c20ef9eabf24920052f1 (diff) | |
| download | caxlsx-ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285.tar.gz caxlsx-ac0600f12fb15d1b3fe0cce1ca7a2dced4cf5285.zip | |
patch nil row style issue
https://github.com/randym/axlsx/issues/91
Diffstat (limited to 'test/workbook')
| -rw-r--r-- | test/workbook/worksheet/tc_cell.rb | 7 | ||||
| -rw-r--r-- | test/workbook/worksheet/tc_row.rb | 12 |
2 files changed, 7 insertions, 12 deletions
diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index 12b4fb4c..edb3ae85 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -244,6 +244,13 @@ class TestCell < Test::Unit::TestCase c_xml = Nokogiri::XML(@c.to_xml_string(1,1)) assert_equal(c_xml.xpath("/c[@s=1]").size, 1) end + + def test_to_xml_string_nil + @c.value = nil + c_xml = Nokogiri::XML(@c.to_xml_string(1,1)) + assert_equal(c_xml.xpath("/c[@s=1]").size, 1) + end + def test_to_xml # TODO This could use some much more stringent testing related to the xml content generated! row = @ws.add_row [Time.now, Date.today, true, 1, 1.0, "text", "=sum(A1:A2)"] diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index f9765a7f..bc6d4139 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -27,18 +27,6 @@ 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)) |
