test/test_04_dimensions.rb in writeexcel-0.3.5 vs test/test_04_dimensions.rb in writeexcel-0.4.0

- old
+ new

@@ -1,5 +1,6 @@ +# -*- coding: utf-8 -*- ############################################################################### # # A test for WriteExcel. # # Check that the Excel DIMENSIONS record is written correctly. @@ -9,26 +10,23 @@ # original written in Perl by John McNamara # converted to Ruby by Hideo Nakamura, cxn03651@msj.biglobe.ne.jp # ############################################################################ require 'helper' +require 'stringio' class TC_dimensions < Test::Unit::TestCase def setup - t = Time.now.strftime("%Y%m%d") - path = "temp#{t}-#{$$}-#{rand(0x100000000).to_s(36)}" - @test_file = File.join(Dir.tmpdir, path) - @workbook = WriteExcel.new(@test_file) + @workbook = WriteExcel.new(StringIO.new) @worksheet = @workbook.add_worksheet @format = @workbook.add_format @dims = ['row_min', 'row_max', 'col_min', 'col_max'] @smiley = [0x263a].pack('n') end def teardown @workbook.close - File.unlink(@test_file) if FileTest.exist?(@test_file) end def test_no_worksheet_cell_data data = @worksheet.store_dimensions