aboutsummaryrefslogtreecommitdiffstats
path: root/test/fileutils/test_fileutils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r--test/fileutils/test_fileutils.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index c1104f31ca..54742d1d18 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -239,6 +239,22 @@ class TestFileUtils
bug4507)
end
+ def test_cp_preserve_permissions_dir
+ bug7246 = '[ruby-core:48603]'
+ mkdir 'tmp/cptmp'
+ mkdir 'tmp/cptmp/d1'
+ chmod 0745, 'tmp/cptmp/d1'
+ mkdir 'tmp/cptmp/d2'
+ chmod 0700, 'tmp/cptmp/d2'
+ cp_r 'tmp/cptmp', 'tmp/cptmp2', :preserve => true
+ assert_equal(File.stat('tmp/cptmp/d1').mode,
+ File.stat('tmp/cptmp2/d1').mode,
+ bug7246)
+ assert_equal(File.stat('tmp/cptmp/d2').mode,
+ File.stat('tmp/cptmp2/d2').mode,
+ bug7246)
+ end
+
def test_cp_symlink
touch 'tmp/cptmp'
# src==dest (2) symlink and its target