summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-24 06:20:31 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-24 06:20:31 +0000
commit462d4e12247f097123001227b1500a84519e41ed (patch)
tree7a5cb8f3c6ae80ad2f4066fb25c625fa8fe62aa5
parent0945e23b078b07e18c6dcf690c33f45a180d3e9f (diff)
use Dir.mktmpdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/dbm/test_dbm.rb5
-rw-r--r--test/gdbm/test_gdbm.rb5
-rw-r--r--test/sdbm/test_sdbm.rb5
3 files changed, 6 insertions, 9 deletions
diff --git a/test/dbm/test_dbm.rb b/test/dbm/test_dbm.rb
index c0d3bb4..bc48831 100644
--- a/test/dbm/test_dbm.rb
+++ b/test/dbm/test_dbm.rb
@@ -28,7 +28,7 @@ if defined? DBM
SYSTEM = uname_s
def setup
- @tmpdir = Dir.tmpdir
+ @tmpdir = Dir.mktmpdir("tmptest_dbm")
@prefix = "tmptest_dbm_#{$$}"
@path = "#{@tmpdir}/#{@prefix}_"
assert_instance_of(DBM, @dbm = DBM.new(@path))
@@ -48,8 +48,7 @@ if defined? DBM
ObjectSpace.each_object(DBM) do |obj|
obj.close unless obj.closed?
end
- File.delete *Dir.glob("#{@tmpdir}/#{@prefix}*").to_a
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ FileUtils.remove_entry_secure @tmpdir
end
def check_size(expect, dbm=@dbm)
diff --git a/test/gdbm/test_gdbm.rb b/test/gdbm/test_gdbm.rb
index 51a8bb3..928efe9 100644
--- a/test/gdbm/test_gdbm.rb
+++ b/test/gdbm/test_gdbm.rb
@@ -28,7 +28,7 @@ if defined? GDBM
SYSTEM = uname_s
def setup
- @tmpdir = Dir.tmpdir
+ @tmpdir = Dir.mktmpdir("tmptest_gdbm")
@prefix = "tmptest_gdbm_#{$$}"
@path = "#{@tmpdir}/#{@prefix}_"
assert_instance_of(GDBM, @gdbm = GDBM.new(@path))
@@ -45,8 +45,7 @@ if defined? GDBM
ObjectSpace.each_object(GDBM) do |obj|
obj.close unless obj.closed?
end
- File.delete *Dir.glob("#{@tmpdir}/#{@prefix}*").to_a
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ FileUtils.remove_entry_secure @tmpdir
end
def check_size(expect, gdbm=@gdbm)
diff --git a/test/sdbm/test_sdbm.rb b/test/sdbm/test_sdbm.rb
index 832e41f..0badf7c 100644
--- a/test/sdbm/test_sdbm.rb
+++ b/test/sdbm/test_sdbm.rb
@@ -8,7 +8,7 @@ end
class TestSDBM < Test::Unit::TestCase
def setup
- @tmpdir = Dir.tmpdir
+ @tmpdir = Dir.mktmpdir("tmptest_sdbm")
@prefix = "tmptest_sdbm_#{$$}"
@path = "#{@tmpdir}/#{@prefix}_"
assert_instance_of(SDBM, @sdbm = SDBM.new(@path))
@@ -18,8 +18,7 @@ class TestSDBM < Test::Unit::TestCase
ObjectSpace.each_object(SDBM) do |obj|
obj.close unless obj.closed?
end
- File.delete *Dir.glob("#{@tmpdir}/#{@prefix}*").to_a
- p Dir.glob("#{@tmpdir}/#{@prefix}*") if $DEBUG
+ FileUtils.remove_entry_secure @tmpdir
end
def check_size(expect, sdbm=@sdbm)