@@ -317,7 +317,7 @@ def test_cp
317
317
def test_cp_preserve_permissions
318
318
bug4507 = '[ruby-core:35518]'
319
319
touch 'tmp/cptmp'
320
- chmod 0755 , 'tmp/cptmp'
320
+ chmod 0o755 , 'tmp/cptmp'
321
321
cp 'tmp/cptmp' , 'tmp/cptmp2'
322
322
323
323
assert_equal_filemode ( 'tmp/cptmp' , 'tmp/cptmp2' , bug4507 , mask : ~File . umask )
@@ -327,9 +327,9 @@ def test_cp_preserve_permissions_dir
327
327
bug7246 = '[ruby-core:48603]'
328
328
mkdir 'tmp/cptmp'
329
329
mkdir 'tmp/cptmp/d1'
330
- chmod 0745 , 'tmp/cptmp/d1'
330
+ chmod 0o745 , 'tmp/cptmp/d1'
331
331
mkdir 'tmp/cptmp/d2'
332
- chmod 0700 , 'tmp/cptmp/d2'
332
+ chmod 0o700 , 'tmp/cptmp/d2'
333
333
cp_r 'tmp/cptmp' , 'tmp/cptmp2' , :preserve => true
334
334
assert_equal_filemode ( 'tmp/cptmp/d1' , 'tmp/cptmp2/d1' , bug7246 )
335
335
assert_equal_filemode ( 'tmp/cptmp/d2' , 'tmp/cptmp2/d2' , bug7246 )
@@ -823,7 +823,7 @@ def test_remove_entry_secure
823
823
if File . sticky? ( 'tmp/tmpdir' )
824
824
Dir . mkdir 'tmp/tmpdir/d' , 0
825
825
assert_raise ( Errno ::EACCES ) { remove_entry_secure 'tmp/tmpdir/d' }
826
- File . chmod 0777 , 'tmp/tmpdir/d'
826
+ File . chmod 0o777 , 'tmp/tmpdir/d'
827
827
Dir . rmdir 'tmp/tmpdir/d'
828
828
end
829
829
end
@@ -1227,9 +1227,9 @@ def test_chmod
1227
1227
check_singleton :chmod
1228
1228
1229
1229
touch 'tmp/a'
1230
- chmod 0700 , 'tmp/a'
1230
+ chmod 0o700 , 'tmp/a'
1231
1231
assert_filemode 0700 , 'tmp/a'
1232
- chmod 0500 , 'tmp/a'
1232
+ chmod 0o500 , 'tmp/a'
1233
1233
assert_filemode 0500 , 'tmp/a'
1234
1234
end if have_file_perm?
1235
1235
@@ -1333,17 +1333,17 @@ def test_chmod_verbose
1333
1333
1334
1334
assert_output_lines ( [ "chmod 700 tmp/a" , "chmod 500 tmp/a" ] ) {
1335
1335
touch 'tmp/a'
1336
- chmod 0700 , 'tmp/a' , verbose : true
1336
+ chmod 0o700 , 'tmp/a' , verbose : true
1337
1337
assert_filemode 0700 , 'tmp/a' , mask : 0777
1338
- chmod 0500 , 'tmp/a' , verbose : true
1338
+ chmod 0o500 , 'tmp/a' , verbose : true
1339
1339
assert_filemode 0500 , 'tmp/a' , mask : 0777
1340
1340
}
1341
1341
end if have_file_perm?
1342
1342
1343
1343
def test_s_chmod_verbose
1344
1344
assert_output_lines ( [ "chmod 700 tmp/a" ] , FileUtils ) {
1345
1345
touch 'tmp/a'
1346
- FileUtils . chmod 0700 , 'tmp/a' , verbose : true
1346
+ FileUtils . chmod 0o700 , 'tmp/a' , verbose : true
1347
1347
assert_filemode 0700 , 'tmp/a' , mask : 0777
1348
1348
}
1349
1349
end if have_file_perm?
@@ -1656,7 +1656,7 @@ def test_remove_file
1656
1656
1657
1657
def test_remove_file_file_perm
1658
1658
File . open ( 'data/tmp' , 'w' ) { |f | f . puts 'dummy' }
1659
- File . chmod 0 , 'data/tmp'
1659
+ File . chmod 0o000 , 'data/tmp'
1660
1660
remove_file 'data/tmp'
1661
1661
assert_file_not_exist 'data/tmp'
1662
1662
end if have_file_perm?
@@ -1671,7 +1671,7 @@ def test_remove_dir
1671
1671
1672
1672
def test_remove_dir_file_perm
1673
1673
Dir . mkdir 'data/tmpdir'
1674
- File . chmod 0555 , 'data/tmpdir'
1674
+ File . chmod 0o555 , 'data/tmpdir'
1675
1675
remove_dir 'data/tmpdir'
1676
1676
assert_file_not_exist 'data/tmpdir'
1677
1677
end if have_file_perm?
@@ -1790,7 +1790,7 @@ def test_rm_rf
1790
1790
return if /mswin|mingw/ =~ RUBY_PLATFORM
1791
1791
1792
1792
mkdir 'tmpdatadir'
1793
- chmod 700 , 'tmpdatadir'
1793
+ chmod 0o700 , 'tmpdatadir'
1794
1794
rm_rf 'tmpdatadir'
1795
1795
1796
1796
assert_file_not_exist 'tmpdatadir'
0 commit comments