summaryrefslogtreecommitdiff
path: root/test/fileutils/test_fileutils.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-04 01:35:49 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-04 01:35:49 +0000
commit0785b3e1b78412499d553522c98ea4d1e5ade324 (patch)
treeddc55810ae6793c0bba1e2ec2deee98cbf13f925 /test/fileutils/test_fileutils.rb
parent03c9bc2b1d793ee3763d5f3437a5f4184fa20c13 (diff)
fileutils.rb: fix error for non-existent entry
* lib/fileutils.rb (FileUtils::Entry_#copy): ensure that the source entry exists first, to fix error for non-existent entry. [ruby-core:77885] [Bug #12892] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils/test_fileutils.rb')
-rw-r--r--test/fileutils/test_fileutils.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 00441a4cfb..0ff0aadca2 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -361,6 +361,11 @@ class TestFileUtils < Test::Unit::TestCase
assert_raise(ArgumentError, bug3588) do
cp_r 'tmp2', 'tmp2/new_tmp2'
end
+
+ bug12892 = '[ruby-core:77885] [Bug #12892]'
+ assert_raise(Errno::ENOENT, bug12892) do
+ cp_r 'non/existent', 'tmp'
+ end
end
def test_cp_r_symlink