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

ruby-changes:20194

From: nobu <ko1@a...>
Date: Mon, 27 Jun 2011 01:34:31 +0900 (JST)
Subject: [ruby-changes:20194] nobu:r32242 (trunk): * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries

nobu	2011-06-27 01:34:20 +0900 (Mon, 27 Jun 2011)

  New Revision: 32242

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

  Log:
    * test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries
      start with + sign, which means NIS.  these are returned in the
      case that passwd and group entries in /etc/nsswitch.conf are set
      to use "nis" explicitly on Debian.  fixed #3683

  Modified files:
    trunk/ChangeLog
    trunk/test/etc/test_etc.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32241)
+++ ChangeLog	(revision 32242)
@@ -1,3 +1,10 @@
+Mon Jun 27 01:34:18 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/etc/test_etc.rb (TestEtc#test_get{pw,gr}nam): skip entries
+	  start with + sign, which means NIS.  these are returned in the
+	  case that passwd and group entries in /etc/nsswitch.conf are set
+	  to use "nis" explicitly on Debian.  fixed #3683
+
 Mon Jun 27 00:44:53 2011  NARUSE, Yui  <naruse@r...>
 
 	* parse.y (rb_parser_end_seen_p): fix documentation about return
Index: test/etc/test_etc.rb
===================================================================
--- test/etc/test_etc.rb	(revision 32241)
+++ test/etc/test_etc.rb	(revision 32242)
@@ -38,7 +38,9 @@
 
   def test_getpwnam
     passwd = {}
-    Etc.passwd {|s| passwd[s.name] ||= s }
+    Etc.passwd do |s|
+      passwd[s.name] ||= s unless /\A\+/ =~ s.name
+    end
     passwd.each_value do |s|
       assert_equal(s, Etc.getpwnam(s.name))
     end
@@ -80,7 +82,7 @@
   def test_getgrnam
     groups = {}
     Etc.group do |s|
-      groups[s.name] ||= s
+      groups[s.name] ||= s unless /\A\+/ =~ s.name
     end
     groups.each_value do |s|
       assert_equal(s, Etc.getgrnam(s.name))

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

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