diff options
| author | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-04 11:46:24 +0000 |
|---|---|---|
| committer | aamine <aamine@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-04 11:46:24 +0000 |
| commit | eea9a0890eee50f51adca9860b316671d5d1e940 (patch) | |
| tree | c26eb632516f4027af4ca99b337aae3aabf54533 /test | |
| parent | dd98c70eac0c21e00db066323bc02b8fc09263db (diff) | |
| download | ruby-eea9a0890eee50f51adca9860b316671d5d1e940.tar.gz ruby-eea9a0890eee50f51adca9860b316671d5d1e940.tar.xz ruby-eea9a0890eee50f51adca9860b316671d5d1e940.zip | |
* lib/fileutils.rb (mkdir, mkdir_p): should chmod explicitly. [ruby-core:03881]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/fileutils/test_fileutils.rb | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index edafcd14e..303c1b42a 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') |
