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

ruby-changes:18785

From: usa <ko1@a...>
Date: Mon, 7 Feb 2011 10:23:38 +0900 (JST)
Subject: [ruby-changes:18785] Ruby:r30811 (trunk): * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):

usa	2011-02-07 10:23:28 +0900 (Mon, 07 Feb 2011)

  New Revision: 30811

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

  Log:
    * test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
      there is no easy way to create owner unreadable file on Windows.
      So, skip the test.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30810)
+++ ChangeLog	(revision 30811)
@@ -1,3 +1,9 @@
+Mon Feb  7 10:21:50 2011  NAKAMURA Usaku  <usa@r...>
+
+	* test/rdoc/test_rdoc_options.rb (TestRDocOptions#test_check_files):
+	  there is no easy way to create owner unreadable file on Windows.
+	  So, skip the test.
+
 Sun Feb  6 13:48:29 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/json/lib/json/common.rb (JSON::MissingUnicodeSupport.iconv):
Index: test/rdoc/test_rdoc_options.rb
===================================================================
--- test/rdoc/test_rdoc_options.rb	(revision 30810)
+++ test/rdoc/test_rdoc_options.rb	(revision 30811)
@@ -17,27 +17,28 @@
   end
 
   def test_check_files
+    expected = ''
     out, err = capture_io do
       Dir.mktmpdir do |dir|
-        begin
-          unreadable = nil # variable for windows
+        if RUBY_PLATFORM =~ /mswin|mingw/ then
+          @options.files = %w[nonexistent]
 
-          Dir.chdir dir do
-            if RUBY_PLATFORM =~ /mswin|mingw/ then
-              unreadable = open 'unreadable'
-              File.delete 'unreadable'
-            else
-              FileUtils.touch 'unreadable'
-              FileUtils.chmod 0, 'unreadable'
-            end
+          expected = <<-EXPECTED
+file 'nonexistent' not found
+          EXPECTED
+        else
+          FileUtils.touch 'unreadable'
+          FileUtils.chmod 0, 'unreadable'
 
-            @options.files = %w[nonexistent unreadable]
+          @options.files = %w[nonexistent unreadable]
 
-            @options.check_files
-          end
-        ensure
-          unreadable.close if unreadable
+          expected = <<-EXPECTED
+file 'nonexistent' not found
+file 'unreadable' not readable
+          EXPECTED
         end
+
+        @options.check_files
       end
     end
 
@@ -45,11 +46,6 @@
 
     assert_equal '', out
 
-    expected = <<-EXPECTED
-file 'nonexistent' not found
-file 'unreadable' not readable
-    EXPECTED
-
     assert_equal expected, err
   end
 

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

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