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

ruby-changes:26290

From: nobu <ko1@a...>
Date: Wed, 12 Dec 2012 16:08:17 +0900 (JST)
Subject: [ruby-changes:26290] nobu:r38341 (trunk): test_rdoc_rdoc.rb: use File::NULL

nobu	2012-12-12 16:08:06 +0900 (Wed, 12 Dec 2012)

  New Revision: 38341

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

  Log:
    test_rdoc_rdoc.rb: use File::NULL
    
    * test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
      use File::NULL for portability if possible.

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

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38340)
+++ ChangeLog	(revision 38341)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Dec 12 16:08:04 2012  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/rdoc/test_rdoc_rdoc.rb (TestRDocRDoc#test_normalized_file_list_non_file_directory):
+	  use File::NULL for portability if possible.
+
 Wed Dec 12 16:07:23 2012  Nobuyoshi Nakada  <nobu@r...>
 
 	* method.h (rb_method_flag_t): name a magic number for NOEX_SAFE and
Index: test/rdoc/test_rdoc_rdoc.rb
===================================================================
--- test/rdoc/test_rdoc_rdoc.rb	(revision 38340)
+++ test/rdoc/test_rdoc_rdoc.rb	(revision 38341)
@@ -123,13 +123,14 @@ class TestRDocRDoc < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rdoc.rb#L123
   end
 
   def test_normalized_file_list_non_file_directory
-    skip '/dev/stdin is not a character special' unless
-      File.chardev? '/dev/stdin'
+    dev = defined?(File::NULL) ? File::NULL : '/dev/stdin'
+    skip "#{dev} is not a character special" unless
+      File.chardev? dev
 
     files = nil
 
     out, err = verbose_capture_io do
-      files = @rdoc.normalized_file_list %w[/dev/stdin]
+      files = @rdoc.normalized_file_list [dev]
     end
 
     files = files.map { |file| File.expand_path file }
@@ -137,8 +138,8 @@ class TestRDocRDoc < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/test/rdoc/test_rdoc_rdoc.rb#L138
     assert_empty files
 
     assert_empty out
-    assert_match %r%^rdoc can't parse%, err
-    assert_match %r%/dev/stdin$%,       err
+    assert_match %r"^rdoc can't parse", err
+    assert_match %r"#{dev}$",           err
   end
 
   def test_parse_file

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

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