From b7da0f92d1eebaa1cd97423e4bb634fd89c78f90 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Fri, 27 Apr 2012 20:06:50 +0900 Subject: test to ensure that add_cell properly updates worksheet column widths. --- test/workbook/worksheet/tc_row.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index a6b4c74a..f9765a7f 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -49,6 +49,12 @@ class TestRow < Test::Unit::TestCase assert_equal(@row.cells.last, c) end + def test_add_cell_autowidth_info + width = @ws.send :calculate_width, 'this is the cell of cells', @ws.workbook.styles.fonts.first.sz + c = @row.add_cell("this is the cell of cells") + assert_equal(@ws.column_info.last.width, width) + end + def test_array_to_cells r = @ws.add_row [1,2,3], :style=>1, :types=>[:integer, :string, :float] assert_equal(r.cells.size, 3) -- cgit v1.2.3