diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 07:35:26 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-15 07:35:26 +0000 |
commit | 39d34270f3e365b57b6f73d2e42dc08ce25c07d9 (patch) | |
tree | 94e981302a9ef2655cd3676a449fce21957dd72b /test | |
parent | 927e8d4f3d700b4f441fd6ea9327be93d32e32fa (diff) | |
download | ruby-39d34270f3e365b57b6f73d2e42dc08ce25c07d9.tar.gz |
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')
-rw-r--r-- | test/fileutils/test_fileutils.rb | 12 |
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 { |