summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-16 19:26:33 +0900
committerRandy Morgan <[email protected]>2012-02-16 19:26:33 +0900
commit1476fd8d0d9a04b03dbc8317d0e94ffa6853ca45 (patch)
treeda3c1f8da434d068330561192bbe0581c642c1bd /test
parent10a46e9956bb1a09bb3144845af9b35bb47726dc (diff)
downloadcaxlsx-1476fd8d0d9a04b03dbc8317d0e94ffa6853ca45.tar.gz
caxlsx-1476fd8d0d9a04b03dbc8317d0e94ffa6853ca45.zip
we need to be able to un-fix a column width
Diffstat (limited to 'test')
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb11
1 files changed, 10 insertions, 1 deletions
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")