From 8c9566435548bad6aadd5651e0694cec74e8af8a Mon Sep 17 00:00:00 2001 From: aamine Date: Thu, 4 Dec 2003 05:09:47 +0000 Subject: [PATCH] * test/fileutils/test_fileutils.rb (test_cp): test if the error is kind of SystemCallError. It is needless details that which errno is set on each systems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ test/fileutils/test_fileutils.rb | 13 ++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95320a64cd..cec27ae47d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Dec 4 14:09:24 2003 Minero Aoki + + * test/fileutils/test_fileutils.rb (test_cp): test if the error is + kind of SystemCallError. It is needless details that which errno + is set on each systems. + Thu Dec 4 13:24:13 2003 Shugo Maeda * lib/monitor.rb: use Object#__send__ instead of Object#send. diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index c2a9be6e3a..0d388a4a5f 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -44,13 +44,6 @@ def have_hardlink? HAVE_HARDLINK end -case RUBY_PLATFORM -when /openbsd/, /freebsd/ - ErrorOnLoopedSymlink = Errno::ELOOP -when /linux/, /netbsd/, /cygwin/, // # FIXME - ErrorOnLoopedSymlink = Errno::EEXIST -end - class TestFileUtils < Test::Unit::TestCase include FileUtils @@ -412,9 +405,11 @@ if have_symlink? } # src==dest (3) looped symlink File.symlink 'cptmp_symlink', 'tmp/cptmp_symlink' - assert_raises(ErrorOnLoopedSymlink) { + begin ln 'tmp/cptmp_symlink', 'tmp/cptmp_symlink' - } + rescue => err + assert_kind_of SystemCallError, err + end end # pathname