summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2012-02-13 19:31:32 +0900
committerRandy Morgan <[email protected]>2012-02-13 19:31:32 +0900
commit6117fc28b5c5e1cf2ca21d9e35ecccf8c626d6fe (patch)
tree568f77629776e50e0834b4235f373fac89444ef3 /test
parentf6ead744b3439ff656165796a4d4bc1c9f47589e (diff)
downloadcaxlsx-6117fc28b5c5e1cf2ca21d9e35ecccf8c626d6fe.tar.gz
caxlsx-6117fc28b5c5e1cf2ca21d9e35ecccf8c626d6fe.zip
adding in support for specified column widths
Diffstat (limited to 'test')
-rw-r--r--test/workbook/worksheet/tc_worksheet.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb
index b7f93d97..3e5bc4c4 100644
--- a/test/workbook/worksheet/tc_worksheet.rb
+++ b/test/workbook/worksheet/tc_worksheet.rb
@@ -136,20 +136,21 @@ class TestWorksheet < Test::Unit::TestCase
@ws.add_row ["chasing windmills", "penut"], :style=>small
assert(@ws.auto_fit_data.size == 2, "a data item for each column")
- assert_equal(@ws.auto_fit_data[0], {:sz=>2,:longest=>"chasing windmills"}, "adding a row updates auto_fit_data if the product of the string length and font is greater for the column")
+ assert_equal(@ws.auto_fit_data[0], {:sz => 2, :longest => "chasing windmills", :fixed=>nil}, "adding a row updates auto_fit_data if the product of the string length and font is greater for the column")
@ws.add_row ["mule"], :style=>big
- assert_equal(@ws.auto_fit_data[0], {:sz=>10,:longest=>"mule"}, "adding a row updates auto_fit_data if the product of the string length and font is greater for the column")
+ assert_equal(@ws.auto_fit_data[0], {:sz=>10,:longest=>"mule", :fixed=>nil}, "adding a row updates auto_fit_data if the product of the string length and font is greater for the column")
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")
assert(@ws.send(:auto_width, {:sz=>11, :longest=>"fish"}) < @ws.send(:auto_width, {:sz=>12, :longest=>"fish"}), "larger fonts produce longer with with same string")
-
+ assert_equal(@ws.send(:auto_width, {:sz=>11, :longest => "This is a really long string", :fixed=>0.2}), 0.2, "fixed rules!")
end
+
def test_merge_cells
assert(@ws.merged_cells.is_a?(Array))
assert_equal(@ws.merged_cells.size, 0)