diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2022-07-19 16:50:00 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-07-19 17:33:44 +0900 |
commit | ee1d2b276abbf6b03d862952a949302672a470a9 (patch) | |
tree | cbb2730bca3b0176334aeacf7a15634f3de002ed | |
parent | d084585f01b57727a5778f2f6723b89c6d98a9d4 (diff) | |
download | ruby-ee1d2b276abbf6b03d862952a949302672a470a9.tar.gz |
[ruby/fileutils] Add an octal prefix to clarify to be octal
https://github.com/ruby/fileutils/commit/332025bc02
Co-Authored-By: David RodrÃguez <deivid.rodriguez@riseup.net>
-rw-r--r-- | test/fileutils/test_fileutils.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 36b5d6ef50..e1e2a829c3 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -317,7 +317,7 @@ class TestFileUtils < Test::Unit::TestCase def test_cp_preserve_permissions bug4507 = '[ruby-core:35518]' touch 'tmp/cptmp' - chmod 0755, 'tmp/cptmp' + chmod 0o755, 'tmp/cptmp' cp 'tmp/cptmp', 'tmp/cptmp2' assert_equal_filemode('tmp/cptmp', 'tmp/cptmp2', bug4507, mask: ~File.umask) @@ -327,9 +327,9 @@ class TestFileUtils < Test::Unit::TestCase bug7246 = '[ruby-core:48603]' mkdir 'tmp/cptmp' mkdir 'tmp/cptmp/d1' - chmod 0745, 'tmp/cptmp/d1' + chmod 0o745, 'tmp/cptmp/d1' mkdir 'tmp/cptmp/d2' - chmod 0700, 'tmp/cptmp/d2' + chmod 0o700, 'tmp/cptmp/d2' cp_r 'tmp/cptmp', 'tmp/cptmp2', :preserve => true assert_equal_filemode('tmp/cptmp/d1', 'tmp/cptmp2/d1', bug7246) assert_equal_filemode('tmp/cptmp/d2', 'tmp/cptmp2/d2', bug7246) @@ -823,7 +823,7 @@ class TestFileUtils < Test::Unit::TestCase if File.sticky?('tmp/tmpdir') Dir.mkdir 'tmp/tmpdir/d', 0 assert_raise(Errno::EACCES) {remove_entry_secure 'tmp/tmpdir/d'} - File.chmod 0777, 'tmp/tmpdir/d' + File.chmod 0o777, 'tmp/tmpdir/d' Dir.rmdir 'tmp/tmpdir/d' end end @@ -1227,9 +1227,9 @@ class TestFileUtils < Test::Unit::TestCase check_singleton :chmod touch 'tmp/a' - chmod 0700, 'tmp/a' + chmod 0o700, 'tmp/a' assert_filemode 0700, 'tmp/a' - chmod 0500, 'tmp/a' + chmod 0o500, 'tmp/a' assert_filemode 0500, 'tmp/a' end if have_file_perm? @@ -1333,9 +1333,9 @@ class TestFileUtils < Test::Unit::TestCase assert_output_lines(["chmod 700 tmp/a", "chmod 500 tmp/a"]) { touch 'tmp/a' - chmod 0700, 'tmp/a', verbose: true + chmod 0o700, 'tmp/a', verbose: true assert_filemode 0700, 'tmp/a', mask: 0777 - chmod 0500, 'tmp/a', verbose: true + chmod 0o500, 'tmp/a', verbose: true assert_filemode 0500, 'tmp/a', mask: 0777 } end if have_file_perm? @@ -1343,7 +1343,7 @@ class TestFileUtils < Test::Unit::TestCase def test_s_chmod_verbose assert_output_lines(["chmod 700 tmp/a"], FileUtils) { touch 'tmp/a' - FileUtils.chmod 0700, 'tmp/a', verbose: true + FileUtils.chmod 0o700, 'tmp/a', verbose: true assert_filemode 0700, 'tmp/a', mask: 0777 } end if have_file_perm? @@ -1656,7 +1656,7 @@ class TestFileUtils < Test::Unit::TestCase def test_remove_file_file_perm File.open('data/tmp', 'w') {|f| f.puts 'dummy' } - File.chmod 0, 'data/tmp' + File.chmod 0o000, 'data/tmp' remove_file 'data/tmp' assert_file_not_exist 'data/tmp' end if have_file_perm? @@ -1671,7 +1671,7 @@ class TestFileUtils < Test::Unit::TestCase def test_remove_dir_file_perm Dir.mkdir 'data/tmpdir' - File.chmod 0555, 'data/tmpdir' + File.chmod 0o555, 'data/tmpdir' remove_dir 'data/tmpdir' assert_file_not_exist 'data/tmpdir' end if have_file_perm? @@ -1790,7 +1790,7 @@ cd - return if /mswin|mingw/ =~ RUBY_PLATFORM mkdir 'tmpdatadir' - chmod 700, 'tmpdatadir' + chmod 0o700, 'tmpdatadir' rm_rf 'tmpdatadir' assert_file_not_exist 'tmpdatadir' |