From 8879d73ffdb21118db48f2a8c4f67c95000e871a Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 29 Aug 2015 01:25:07 +0000 Subject: test: try File.symlink with invalid paths * test (have_symlink?): try File.symlink with invalid paths to test the administrator privilege, nil just raises an ArgumentError before trying the actual API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/fileutils/test_fileutils.rb | 2 +- test/pathname/test_pathname.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 28488cd27f..fffa2b8853 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -47,7 +47,7 @@ class TestFileUtils < Test::Unit::TestCase end def check_have_symlink? - File.symlink nil, nil + File.symlink "", "" rescue NotImplementedError, Errno::EACCES return false rescue diff --git a/test/pathname/test_pathname.rb b/test/pathname/test_pathname.rb index 4842f96d0f..2917ebb557 100644 --- a/test/pathname/test_pathname.rb +++ b/test/pathname/test_pathname.rb @@ -339,7 +339,7 @@ class TestPathname < Test::Unit::TestCase def has_symlink? begin - File.symlink(nil, nil) + File.symlink("", "") rescue NotImplementedError, Errno::EACCES return false rescue TypeError -- cgit v1.2.3