summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-04 11:46:24 +0000
committeraamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-04 11:46:24 +0000
commit7c0370dcafee76642ea40d1a3488078f744910b4 (patch)
treec26eb632516f4027af4ca99b337aae3aabf54533 /test
parent500bd1f033c8c0f2e7bbe8d864334681be1ce0b5 (diff)
* lib/fileutils.rb (mkdir, mkdir_p): should chmod explicitly. [ruby-core:03881]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/fileutils/test_fileutils.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index edafcd14e6..303c1b42a0 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -16,7 +16,7 @@ Dir.mkdir tmproot unless File.directory?(tmproot)
Dir.chdir tmproot
def have_drive_letter?
- /djgpp|mswin(?!ce)|mingw|bcc|emx/ === RUBY_PLATFORM
+ /djgpp|mswin(?!ce)|mingw|bcc|emx/ =~ RUBY_PLATFORM
end
def have_file_perm?
@@ -579,10 +579,17 @@ end
assert_equal 0700, (File.stat('tmp/tmp').mode & 0777) if have_file_perm?
Dir.rmdir 'tmp/tmp'
+if have_file_perm?
+ mkdir 'tmp/tmp', :mode => 07777
+ assert_directory 'tmp/tmp'
+ assert_equal 07777, (File.stat('tmp/tmp').mode & 07777)
+ Dir.rmdir 'tmp/tmp'
+end
+
if lf_in_path_allowed?
- mkdir "tmp-first-line\ntmp-second-line"
- assert_directory "tmp-first-line\ntmp-second-line"
- Dir.rmdir "tmp-first-line\ntmp-second-line"
+ mkdir "tmp-first-line\ntmp-second-line"
+ assert_directory "tmp-first-line\ntmp-second-line"
+ Dir.rmdir "tmp-first-line\ntmp-second-line"
end
# pathname
@@ -641,6 +648,14 @@ end
Dir.rmdir 'tmp/tmp'
Dir.rmdir 'tmp'
+if have_file_perm?
+ mkdir_p 'tmp/tmp/tmp', :mode => 07777
+ assert_directory 'tmp/tmp/tmp'
+ assert_equal 07777, (File.stat('tmp/tmp/tmp').mode & 07777)
+ Dir.rmdir 'tmp/tmp/tmp'
+ Dir.rmdir 'tmp/tmp'
+end
+
# pathname
assert_nothing_raised {
mkdir_p Pathname.new('tmp/tmp/tmp')