From 1476fd8d0d9a04b03dbc8317d0e94ffa6853ca45 Mon Sep 17 00:00:00 2001 From: Randy Morgan Date: Thu, 16 Feb 2012 19:26:33 +0900 Subject: we need to be able to un-fix a column width --- test/workbook/worksheet/tc_worksheet.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/workbook') diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index 96ebfbdf..4a358c2c 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -156,10 +156,19 @@ class TestWorksheet < Test::Unit::TestCase def test_fixed_widths_with_merged_cells @ws.add_row ["hey, I'm like really long and stuff so I think you will merge me."] + @ws.merge_cells "A1:C1" @ws.add_row ["but Im Short!"], :widths=> [14.8] assert_equal(@ws.send(:auto_width, @ws.auto_fit_data[0]), 14.8) end - + + def test_fixed_width_to_auto + @ws.add_row ["hey, I'm like really long and stuff so I think you will merge me."] + @ws.merge_cells "A1:C1" + @ws.add_row ["but Im Short!"], :widths=> [14.8] + assert_equal(@ws.send(:auto_width, @ws.auto_fit_data[0]), 14.8) + @ws.add_row ["no, I like auto!"], :widths=>[:auto] + assert_equal(@ws.auto_fit_data[0][:fixed], nil) + end def test_auto_width assert(@ws.send(:auto_width, {:sz=>11, :longest=>"fisheries"}) > @ws.send(:auto_width, {:sz=>11, :longest=>"fish"}), "longer strings get a longer auto_width at the same font size") -- cgit v1.2.3