test/workbook/worksheet/tc_worksheet.rb in axlsx-1.0.0 vs test/workbook/worksheet/tc_worksheet.rb in axlsx-1.0.1
- old
+ new
@@ -29,11 +29,11 @@
assert_equal(@ws.index, @ws.workbook.worksheets.index(@ws))
end
def test_add_row
assert(@ws.rows.empty?, "sheet has no rows by default")
- r = @ws.add_row(:values=>[1,2,3])
+ r = @ws.add_row([1,2,3])
assert_equal(@ws.rows.size, 1, "add_row adds a row")
assert_equal(@ws.rows.first, r, "the row returned is the row added")
end
def test_add_chart
@@ -68,13 +68,13 @@
def test_update_auto_with_data
small = @ws.workbook.styles.add_style(:sz=>2)
big = @ws.workbook.styles.add_style(:sz=>10)
- @ws.add_row :values=>["chasing windmills", "penut"], :style=>small
+ @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")
- @ws.add_row :values=> ["mule"], :style=>big
+ @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")
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")