ruby-changes:2274
From: ko1@a...
Date: 24 Oct 2007 16:11:49 +0900
Subject: [ruby-changes:2274] akr - Ruby:r13765 (trunk): specify prefix for Dir.mktmpdir.
akr 2007-10-24 16:11:35 +0900 (Wed, 24 Oct 2007)
New Revision: 13765
Modified files:
trunk/test/pathname/test_pathname.rb
trunk/test/ruby/test_dir.rb
trunk/test/ruby/test_file.rb
Log:
specify prefix for Dir.mktmpdir.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_file.rb?r1=13765&r2=13764
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/pathname/test_pathname.rb?r1=13765&r2=13764
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_dir.rb?r1=13765&r2=13764
Index: test/ruby/test_dir.rb
===================================================================
--- test/ruby/test_dir.rb (revision 13764)
+++ test/ruby/test_dir.rb (revision 13765)
@@ -6,7 +6,7 @@
class TestDir < Test::Unit::TestCase
def setup
- @root = Dir.mktmpdir
+ @root = Dir.mktmpdir('__test_dir__')
for i in ?a..?z
if i.ord % 2 == 0
FileUtils.touch(File.join(@root, i))
Index: test/ruby/test_file.rb
===================================================================
--- test/ruby/test_file.rb (revision 13764)
+++ test/ruby/test_file.rb (revision 13765)
@@ -7,7 +7,7 @@
# I don't know Ruby's spec about "unlink-before-close" exactly.
# This test asserts current behaviour.
def test_unlink_before_close
- Dir.mktmpdir {|tmpdir|
+ Dir.mktmpdir('rubytest-file') {|tmpdir|
filename = tmpdir + '/' + File.basename(__FILE__) + ".#{$$}"
w = File.open(filename, "w")
w << "foo"
Index: test/pathname/test_pathname.rb
===================================================================
--- test/pathname/test_pathname.rb (revision 13764)
+++ test/pathname/test_pathname.rb (revision 13765)
@@ -287,7 +287,7 @@
return
rescue TypeError
end
- Dir.mktmpdir {|dir|
+ Dir.mktmpdir('rubytest-pathname') {|dir|
File.symlink("not-exist-target", "#{dir}/not-exist")
assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
File.symlink("loop", "#{dir}/loop")
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml