ruby-changes:39638
From: nobu <ko1@a...>
Date: Sat, 29 Aug 2015 10:25:28 +0900 (JST)
Subject: [ruby-changes:39638] nobu:r51719 (trunk): test: try File.symlink with invalid paths
nobu 2015-08-29 10:25:07 +0900 (Sat, 29 Aug 2015) New Revision: 51719 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51719 Log: 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. Modified files: trunk/test/fileutils/test_fileutils.rb trunk/test/pathname/test_pathname.rb Index: test/fileutils/test_fileutils.rb =================================================================== --- test/fileutils/test_fileutils.rb (revision 51718) +++ test/fileutils/test_fileutils.rb (revision 51719) @@ -47,7 +47,7 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L47 end def check_have_symlink? - File.symlink nil, nil + File.symlink "", "" rescue NotImplementedError, Errno::EACCES return false rescue Index: test/pathname/test_pathname.rb =================================================================== --- test/pathname/test_pathname.rb (revision 51718) +++ test/pathname/test_pathname.rb (revision 51719) @@ -339,7 +339,7 @@ class TestPathname < Test::Unit::TestCas https://github.com/ruby/ruby/blob/trunk/test/pathname/test_pathname.rb#L339 def has_symlink? begin - File.symlink(nil, nil) + File.symlink("", "") rescue NotImplementedError, Errno::EACCES return false rescue TypeError -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/