mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
specify prefix for Dir.mktmpdir.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7eee7f1cde
commit
7989a0868d
3 changed files with 3 additions and 3 deletions
|
@ -287,7 +287,7 @@ class TestPathname < Test::Unit::TestCase
|
||||||
return
|
return
|
||||||
rescue TypeError
|
rescue TypeError
|
||||||
end
|
end
|
||||||
Dir.mktmpdir {|dir|
|
Dir.mktmpdir('rubytest-pathname') {|dir|
|
||||||
File.symlink("not-exist-target", "#{dir}/not-exist")
|
File.symlink("not-exist-target", "#{dir}/not-exist")
|
||||||
assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
|
assert_raise(Errno::ENOENT) { realpath("#{dir}/not-exist") }
|
||||||
File.symlink("loop", "#{dir}/loop")
|
File.symlink("loop", "#{dir}/loop")
|
||||||
|
|
|
@ -6,7 +6,7 @@ require 'fileutils'
|
||||||
class TestDir < Test::Unit::TestCase
|
class TestDir < Test::Unit::TestCase
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@root = Dir.mktmpdir
|
@root = Dir.mktmpdir('__test_dir__')
|
||||||
for i in ?a..?z
|
for i in ?a..?z
|
||||||
if i.ord % 2 == 0
|
if i.ord % 2 == 0
|
||||||
FileUtils.touch(File.join(@root, i))
|
FileUtils.touch(File.join(@root, i))
|
||||||
|
|
|
@ -7,7 +7,7 @@ class TestFile < Test::Unit::TestCase
|
||||||
# I don't know Ruby's spec about "unlink-before-close" exactly.
|
# I don't know Ruby's spec about "unlink-before-close" exactly.
|
||||||
# This test asserts current behaviour.
|
# This test asserts current behaviour.
|
||||||
def test_unlink_before_close
|
def test_unlink_before_close
|
||||||
Dir.mktmpdir {|tmpdir|
|
Dir.mktmpdir('rubytest-file') {|tmpdir|
|
||||||
filename = tmpdir + '/' + File.basename(__FILE__) + ".#{$$}"
|
filename = tmpdir + '/' + File.basename(__FILE__) + ".#{$$}"
|
||||||
w = File.open(filename, "w")
|
w = File.open(filename, "w")
|
||||||
w << "foo"
|
w << "foo"
|
||||||
|
|
Loading…
Reference in a new issue