ruby-changes:46611
From: usa <ko1@a...>
Date: Mon, 15 May 2017 16:35:33 +0900 (JST)
Subject: [ruby-changes:46611] usa:r58726 (trunk): Should call `ln_s` only when symlink is available
usa 2017-05-15 16:35:26 +0900 (Mon, 15 May 2017) New Revision: 58726 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58726 Log: Should call `ln_s` only when symlink is available * test/fileutils/test_fileutils.rb (test_ln_s): skip if symlink is not available. * test/fileutils/test_fileutils.rb (test_ln_s): remove created symlink certainly. Modified files: trunk/test/fileutils/test_fileutils.rb Index: test/fileutils/test_fileutils.rb =================================================================== --- test/fileutils/test_fileutils.rb (revision 58725) +++ test/fileutils/test_fileutils.rb (revision 58726) @@ -785,12 +785,14 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L785 TARGETS.each do |fname| fname = "../#{fname}" - ln_s fname, 'tmp/lnsdest' - assert FileTest.symlink?('tmp/lnsdest'), 'not symlink' - assert_equal fname, File.readlink('tmp/lnsdest') - rm_f 'tmp/lnsdest' + lnfname = 'tmp/lnsdest' + ln_s fname, lnfname + assert FileTest.symlink?(lnfname), 'not symlink' + assert_equal fname, File.readlink(lnfname) + ensure + rm_f lnfname end - end + end if have_symlink? and !no_broken_symlink? def test_ln_s_broken_symlink assert_nothing_raised { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/