1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/fileutils.rb (mkdir_p): should pass mode argument to Dir.mkdir. [ruby-dev:24242]

* test/fileutils/test_fileutils.rb: test it.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
aamine 2004-09-10 06:56:20 +00:00
parent 54876834a6
commit ed1a776ae0
3 changed files with 16 additions and 1 deletions

View file

@ -633,6 +633,14 @@ end
assert_equal 0700, (File.stat('tmp/tmp/tmp').mode & 0777) if have_file_perm?
rm_rf 'tmp/tmp'
mkdir_p 'tmp/tmp', :mode => 0
assert_directory 'tmp/tmp'
assert_equal 0, (File.stat('tmp/tmp').mode & 0777) if have_file_perm?
# DO NOT USE rm_rf here.
# (rm(1) try to chdir to parent directory, it fails to remove directory.)
Dir.rmdir 'tmp/tmp'
Dir.rmdir 'tmp'
# pathname
assert_nothing_raised {
mkdir_p Pathname.new('tmp/tmp/tmp')