mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/fileutils/test_fileutils.rb (cp_r): tested wrong file name. [ruby-dev:25339]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ea12b3eb53
commit
3cf02cc03e
2 changed files with 19 additions and 3 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Dec 27 15:29:12 2004 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
* test/fileutils/test_fileutils.rb (cp_r): tested wrong file name.
|
||||||
|
[ruby-dev:25339]
|
||||||
|
|
||||||
Mon Dec 27 15:15:18 2004 Minero Aoki <aamine@loveruby.net>
|
Mon Dec 27 15:15:18 2004 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
* lib/fileutils.rb (mv): should raise error when moving a
|
* lib/fileutils.rb (mv): should raise error when moving a
|
||||||
|
|
|
@ -68,7 +68,7 @@ class TestFileUtils
|
||||||
|
|
||||||
include FileUtils
|
include FileUtils
|
||||||
|
|
||||||
def my_rm_rf( path )
|
def my_rm_rf(path)
|
||||||
if File.exist?('/bin/rm')
|
if File.exist?('/bin/rm')
|
||||||
system %Q[/bin/rm -rf "#{path}"]
|
system %Q[/bin/rm -rf "#{path}"]
|
||||||
else
|
else
|
||||||
|
@ -235,8 +235,8 @@ end
|
||||||
|
|
||||||
cp_r 'data', 'tmp2', :preserve => true
|
cp_r 'data', 'tmp2', :preserve => true
|
||||||
TARGETS.each do |fname|
|
TARGETS.each do |fname|
|
||||||
assert_same_entry fname, "tmp/#{fname}"
|
assert_same_entry fname, "tmp2/#{File.basename(fname)}"
|
||||||
assert_same_file fname, "tmp/#{fname}"
|
assert_same_file fname, "tmp2/#{File.basename(fname)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
# a/* -> b/*
|
# a/* -> b/*
|
||||||
|
@ -294,6 +294,17 @@ end
|
||||||
assert_same_file fname, 'tmp/mvdest'
|
assert_same_file fname, 'tmp/mvdest'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# [ruby-talk:124368]
|
||||||
|
mkdir 'tmp/tmpdir'
|
||||||
|
mkdir_p 'tmp/dest2/tmpdir'
|
||||||
|
assert_raises(Errno::EISDIR) {
|
||||||
|
mv 'tmp/tmpdir', 'tmp/dest2'
|
||||||
|
}
|
||||||
|
mkdir 'tmp/dest2/tmpdir/junk'
|
||||||
|
assert_raises(Errno::EISDIR) {
|
||||||
|
mv 'tmp/tmpdir', 'tmp/dest2'
|
||||||
|
}
|
||||||
|
|
||||||
# src==dest (1) same path
|
# src==dest (1) same path
|
||||||
touch 'tmp/cptmp'
|
touch 'tmp/cptmp'
|
||||||
assert_raises(ArgumentError) {
|
assert_raises(ArgumentError) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue