summaryrefslogtreecommitdiffhomepage
path: root/test/workbook
diff options
context:
space:
mode:
Diffstat (limited to 'test/workbook')
-rw-r--r--test/workbook/worksheet/tc_cell.rb7
-rw-r--r--test/workbook/worksheet/tc_row.rb12
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))