about summary refs log tree commit homepage
path: root/test/lib_read_write.rb
diff options
context:
space:
mode:
authorHleb Valoshka <375gnu@gmail.com>2013-09-04 15:07:19 +0300
committerEric Wong <normalperson@yhbt.net>2013-09-04 17:29:19 +0000
commit90340eb8f2c5bf820eabd3c25fb39e45285b1c40 (patch)
tree061d89a6124252689469eaf9621895d0f90e76c2 /test/lib_read_write.rb
parent71f656e40de99d240c873ebb23451f76e46e5a20 (diff)
downloadkgio-90340eb8f2c5bf820eabd3c25fb39e45285b1c40.tar.gz
[ew: this avoids a TOCTOU issue for multiple test invocations]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'test/lib_read_write.rb')
-rw-r--r--test/lib_read_write.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/test/lib_read_write.rb b/test/lib_read_write.rb
index 5034db8..cac87b7 100644
--- a/test/lib_read_write.rb
+++ b/test/lib_read_write.rb
@@ -2,6 +2,7 @@
 require 'test/unit'
 require 'io/nonblock'
 require 'digest/sha1'
+require 'fileutils'
 $-w = true
 require 'kgio'
 
@@ -11,6 +12,7 @@ module LibReadWriteTest
   def teardown
     @rd.close if defined?(@rd) && ! @rd.closed?
     @wr.close if defined?(@wr) && ! @wr.closed?
+    FileUtils.remove_entry_secure(@tmpdir) if defined?(@tmpdir)
   end
 
   def test_write_empty