summaryrefslogtreecommitdiff
path: root/test/fileutils
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:35:26 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-05-15 07:35:26 +0000
commita852853f447710072f8dbea8de4960ecfe5bfd0d (patch)
tree94e981302a9ef2655cd3676a449fce21957dd72b /test/fileutils
parentfba0b81e183be1e477be8e57779512e876cca02f (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/fileutils')
-rw-r--r--test/fileutils/test_fileutils.rb12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb
index 16257e6091..923468d2b9 100644
--- a/test/fileutils/test_fileutils.rb
+++ b/test/fileutils/test_fileutils.rb
@@ -785,12 +785,14 @@ class TestFileUtils < Test::Unit::TestCase
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 {