From 3d92d0a135afef7dfc1b9530d3983d97d09fe9cb Mon Sep 17 00:00:00 2001 From: aamine Date: Wed, 10 Mar 2004 13:41:43 +0000 Subject: [PATCH] * test/fileutils/test_fileutils.rb (test_rm_r): test if rm_rf can remove a symlink to the directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 34d5a73882..726aa10490 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -365,6 +365,15 @@ end assert_file_not_exist 'tmp/tmpdir' assert_file_exist 'tmp' +if have_symlink? + # [ruby-talk:94635] a symlink to the directory + Dir.mkdir 'tmp/tmpdir' + File.symlink '..', 'tmp/tmpdir/symlink_to_dir' + rm_r 'tmp/tmpdir' + assert_file_not_exist 'tmp/tmpdir' + assert_file_exist 'tmp' +end + # pathname Dir.mkdir 'tmp/tmpdir1'; touch 'tmp/tmpdir1/tmp' Dir.mkdir 'tmp/tmpdir2'; touch 'tmp/tmpdir2/tmp'