[前][次][番号順一覧][スレッド一覧]

ruby-changes:45574

From: nobu <ko1@a...>
Date: Fri, 17 Feb 2017 22:31:48 +0900 (JST)
Subject: [ruby-changes:45574] nobu:r57647 (trunk): test_fileutils.rb: fix relative symlink path

nobu	2017-02-17 22:31:42 +0900 (Fri, 17 Feb 2017)

  New Revision: 57647

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57647

  Log:
    test_fileutils.rb: fix relative symlink path
    
    * test/fileutils/test_fileutils.rb (test_rm_symlink): fix relative
      symlink path, the target should be relative to the directory in
      which the symlink gets created.

  Modified files:
    trunk/test/fileutils/test_fileutils.rb
Index: test/fileutils/test_fileutils.rb
===================================================================
--- test/fileutils/test_fileutils.rb	(revision 57646)
+++ test/fileutils/test_fileutils.rb	(revision 57647)
@@ -530,7 +530,7 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L530
 
   def test_rm_symlink
     File.open('tmp/lnf_symlink_src', 'w') {|f| f.puts 'dummy' }
-    File.symlink 'tmp/lnf_symlink_src', 'tmp/lnf_symlink_dest'
+    File.symlink 'lnf_symlink_src', 'tmp/lnf_symlink_dest'
     rm_f 'tmp/lnf_symlink_dest'
     assert_file_not_exist 'tmp/lnf_symlink_dest'
     assert_file_exist     'tmp/lnf_symlink_src'
@@ -767,6 +767,7 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L767
     check_singleton :ln_s
 
     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')
@@ -790,6 +791,7 @@ class TestFileUtils < Test::Unit::TestCa https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L791
     check_singleton :ln_sf
 
     TARGETS.each do |fname|
+      fname = "../#{fname}"
       ln_sf fname, 'tmp/lnsdest'
       assert FileTest.symlink?('tmp/lnsdest'), 'not symlink'
       assert_equal fname, File.readlink('tmp/lnsdest')

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]