From ee647e1b96982c7ff459d7af1a6109f7d54f61c1 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 9 Sep 2009 13:02:04 +0000 Subject: * lib/fileutils.rb (FileUtils::Entry_#copy_file): open the source file first to ensure it can be copied. [ruby-core:25498] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 3117193385..13df0fc133 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -223,6 +223,11 @@ end assert_same_entry srcpath, destpath end + assert_raise(Errno::ENOENT) { + cp 'tmp/cptmp', 'tmp/cptmp_new' + } + assert_file_not_exist('tmp/cptmp_new') + # src==dest (1) same path touch 'tmp/cptmp' assert_raise(ArgumentError) { -- cgit v1.2.3