test/test_04_dimensions.rb in writeexcel-0.6.18 vs test/test_04_dimensions.rb in writeexcel-0.6.19
- old
+ new
@@ -22,10 +22,19 @@
@format = @workbook.add_format
@dims = ['row_min', 'row_max', 'col_min', 'col_max']
@smiley = [0x263a].pack('n')
end
+ def teardown
+ if @workbook.instance_variable_get(:@filehandle)
+ @workbook.instance_variable_get(:@filehandle).close(true)
+ end
+ if @worksheet.instance_variable_get(:@filehandle)
+ @worksheet.instance_variable_get(:@filehandle).close(true)
+ end
+ end
+
def test_no_worksheet_cell_data
data = @worksheet.__send__("store_dimensions")
vals = data.unpack('x4 VVvv')
alist = @dims.zip(vals)
@@ -365,9 +374,16 @@
alist = @dims.zip([5, 6, 3, 4])
expected = Hash[*alist.flatten]
assert_equal(expected, results)
+ end
+
+ def test_store_formula_should_not_change_formula_string
+ formula = '=SUM(A1:D1)'
+ @worksheet.store_formula(formula)
+
+ assert_equal('=SUM(A1:D1)', formula)
end
def test_merge_range
formula = @worksheet.__send__("store_formula", '=A1 * 3 + 50')
@worksheet.merge_range('C6:E8', 'Test', @format)