about summary refs log tree commit homepage
path: root/test/test_tryopen.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_tryopen.rb')
-rw-r--r--test/test_tryopen.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_tryopen.rb b/test/test_tryopen.rb
index abcbd37..2bbbc51 100644
--- a/test/test_tryopen.rb
+++ b/test/test_tryopen.rb
@@ -59,8 +59,9 @@ class TestTryopen < Test::Unit::TestCase
     tmp.close!
     file = Kgio::File.tryopen(path, IO::RDWR|IO::CREAT, 0000)
     assert_equal 0100000, File.stat(path).mode
-    ensure
-      File.unlink path
+    file.close
+  ensure
+    File.unlink path
   end
 
   require "benchmark"