ruby-changes:38060
From: nobu <ko1@a...>
Date: Wed, 1 Apr 2015 09:59:33 +0900 (JST)
Subject: [ruby-changes:38060] nobu:r50141 (trunk): fileutils.rb: fix error message
nobu 2015-04-01 09:59:14 +0900 (Wed, 01 Apr 2015) New Revision: 50141 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50141 Log: fileutils.rb: fix error message * lib/fileutils.rb (FileUtils#mv): show the exact target path in the error message instead of the destination parent directory name. patched by Jo?\195?\163o Britto <jabcalves AT gmail.com> at [ruby-core:68706]. [Bug #11021] Modified files: trunk/ChangeLog trunk/lib/fileutils.rb trunk/test/fileutils/test_fileutils.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 50140) +++ ChangeLog (revision 50141) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Apr 1 09:59:12 2015 Nobuyoshi Nakada <nobu@r...> + + * lib/fileutils.rb (FileUtils#mv): show the exact target path in + the error message instead of the destination parent directory + name. patched by Joao Britto <jabcalves AT gmail.com> at + [ruby-core:68706]. [Bug #11021] + Tue Mar 31 15:25:07 2015 SHIBATA Hiroshi <shibata.hiroshi@g...> * doc/ChangeLog-0.06_to_0.52: added archived Changelog. Index: lib/fileutils.rb =================================================================== --- lib/fileutils.rb (revision 50140) +++ lib/fileutils.rb (revision 50141) @@ -518,7 +518,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L518 begin if destent.exist? if destent.directory? - raise Errno::EEXIST, dest + raise Errno::EEXIST, d else destent.remove_file if rename_cannot_overwrite_file? end Index: test/fileutils/test_fileutils.rb =================================================================== --- test/fileutils/test_fileutils.rb (revision 50140) +++ test/fileutils/test_fileutils.rb (revision 50141) @@ -416,7 +416,8 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L416 mkdir 'tmp/tmpdir' mkdir_p 'tmp/dest2/tmpdir' - assert_raise(Errno::EEXIST) { + assert_raise_with_message(Errno::EEXIST, %r' - tmp/dest2/tmpdir\z', + '[ruby-core:68706] [Bug #11021]') { mv 'tmp/tmpdir', 'tmp/dest2' } mkdir 'tmp/dest2/tmpdir/junk' -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/