summaryrefslogtreecommitdiff
path: root/test/fileutils
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-17 23:48:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-03-17 23:48:13 +0000
commitc7837ed8d3ec3a74382927df7c2fae19862b78ea (patch)
tree9b43f96e88e7680facbee15bceab4774c4cd13dd /test/fileutils
parent58e8b41eb18715949c8bca673427ddc90b548f7b (diff)
* lib/fileutils.rb (FileUtils::Entry_#copy_file): updated FileUtils.cp
to still copy file permissions when :preserve is false (as cp does this even when -p isn't set). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 3ec8dce2d5..290ba21f0d 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -230,6 +230,16 @@ class TestFileUtils
}
end
+ def test_cp_preserve_permissions
+ bug4507 = '[ruby-core:35518]'
+ touch 'tmp/cptmp'
+ chmod 0755, 'tmp/cptmp'
+ cp 'tmp/cptmp', 'tmp/cptmp2'
+ assert_equal(File.stat('tmp/cptmp').mode,
+ File.stat('tmp/cptmp2').mode,
+ bug4507)
+ end
+
def test_cp_symlink
touch 'tmp/cptmp'
# src==dest (2) symlink and its target