summaryrefslogtreecommitdiffhomepage
path: root/test/workbook/worksheet/tc_row.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-04-25 20:30:57 +0900
committerRandy Morgan <[email protected]>2012-04-25 20:30:57 +0900
commit4242c992d411125d09519c27e56933c1e6a9ae16 (patch)
tree8ef61ace71b40cce6ffb8035e3c5ea66a2d9dfa9 /test/workbook/worksheet/tc_row.rb
parent672aae6fd76c761006868c42062e153e56da2a09 (diff)
downloadcaxlsx-4242c992d411125d09519c27e56933c1e6a9ae16.tar.gz
caxlsx-4242c992d411125d09519c27e56933c1e6a9ae16.zip
bug fix to properly assign style/type data when creating rows and partial style/types arrays
Diffstat (limited to 'test/workbook/worksheet/tc_row.rb')
-rw-r--r--test/workbook/worksheet/tc_row.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb
index a953566e..a6b4c74a 100644
--- a/test/workbook/worksheet/tc_row.rb
+++ b/test/workbook/worksheet/tc_row.rb
@@ -32,7 +32,7 @@ class TestRow < Test::Unit::TestCase
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, ''))
@@ -50,8 +50,15 @@ class TestRow < Test::Unit::TestCase
end
def test_array_to_cells
- r = @ws.add_row [1,2,3], :style=>0, :types=>:integer
+ r = @ws.add_row [1,2,3], :style=>1, :types=>[:integer, :string, :float]
assert_equal(r.cells.size, 3)
+ r.cells.each do |c|
+ assert_equal(c.style, 1)
+ end
+ r = @ws.add_row [1,2,3], :style=>[1]
+ assert_equal(r.cells.first.style, 1, "only apply style to cells with at the same index of of the style array")
+ assert_equal(r.cells.last.style, 0, "only apply style to cells with at the same index of of the style array")
+
end
def test_custom_height