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

ruby-changes:26021

From: usa <ko1@a...>
Date: Sat, 1 Dec 2012 02:15:14 +0900 (JST)
Subject: [ruby-changes:26021] usa:r38077 (trunk): * test/rdoc/test_rdoc_rubygems_hook.rb

usa	2012-12-01 02:11:11 +0900 (Sat, 01 Dec 2012)

  New Revision: 38077

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38077

  Log:
    * test/rdoc/test_rdoc_rubygems_hook.rb
      (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existance
      of the file(directory) before touch it.  2. remove test
      file(directory) after the test.  see [ruby-core:50388].

  Modified files:
    trunk/ChangeLog
    trunk/test/rdoc/test_rdoc_rubygems_hook.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38076)
+++ ChangeLog	(revision 38077)
@@ -1,3 +1,10 @@
+Sat Dec  1 02:08:16 2012  NAKAMURA Usaku  <usa@r...>
+
+	* test/rdoc/test_rdoc_rubygems_hook.rb
+	  (TestRDocRubygemsHook#test_setup_unwritable): 1. check the existance
+	  of the file(directory) before touch it.  2. remove test
+	  file(directory) after the test.  see [ruby-core:50388].
+
 Sat Dec  1 01:51:06 2012  Koichi Sasada  <ko1@a...>
 
 	[EXPERIMENTAL]
Index: test/rdoc/test_rdoc_rubygems_hook.rb
===================================================================
--- test/rdoc/test_rdoc_rubygems_hook.rb	(revision 38076)
+++ test/rdoc/test_rdoc_rubygems_hook.rb	(revision 38077)
@@ -202,16 +202,21 @@
 
   def test_setup_unwritable
     skip 'chmod not supported' if Gem.win_platform?
-    FileUtils.mkdir_p @a.doc_dir
-    FileUtils.chmod 0, @a.doc_dir
+    begin
+      FileUtils.mkdir_p @a.doc_dir
+      FileUtils.chmod 0, @a.doc_dir
 
-    e = assert_raises Gem::FilePermissionError do
-      @hook.setup
+      e = assert_raises Gem::FilePermissionError do
+        @hook.setup
+      end
+
+      assert_equal @a.doc_dir, e.directory
+    ensure
+      if File.exist? @a.doc_dir
+        FileUtils.chmod 0755, @a.doc_dir
+        FileUtils.rm_r @a.doc_dir
+      end
     end
-
-    assert_equal @a.doc_dir, e.directory
-  ensure
-    FileUtils.chmod 0755, @a.doc_dir
   end
 
 end

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

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