test/test_roo.rb in roo-2.4.0 vs test/test_roo.rb in roo-2.5.0
- old
+ new
@@ -15,10 +15,12 @@
# Dump warnings that come from the test to open files
# with the wrong spreadsheet class
#STDERR.reopen "/dev/null","w"
+Encoding.default_external = "UTF-8"
+
require 'test_helper'
require 'stringio'
class TestRoo < Minitest::Test
@@ -2083,9 +2085,22 @@
def test_close
with_each_spreadsheet(:name=>'numbers1') do |oo|
next unless (tempdir = oo.instance_variable_get('@tmpdir'))
oo.close
+ assert !File.exists?(tempdir), "Expected #{tempdir} to be cleaned up, but it still exists"
+ end
+ end
+
+ def test_finalize
+ tempdirs = []
+ begin
+ with_each_spreadsheet(:name=>'numbers1') do |oo|
+ tempdirs << oo.instance_variable_get('@tmpdir')
+ end
+ GC.start
+ end
+ tempdirs.each do |tempdir|
assert !File.exists?(tempdir), "Expected #{tempdir} to be cleaned up, but it still exists"
end
end
def test_cleanup_on_error