summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-11 00:37:50 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-11 00:37:50 +0000
commit9d46a8085e643b4dee91a558d5a8d32ba331925a (patch)
tree69c12f707cd93ecdc9a03381d20efb3a971ad0c8 /test
parent9ff7e818878c637a4b6c19d97bacd4f2dc2601b1 (diff)
merges r32242 from trunk into ruby_1_9_2.
-- * 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@32910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/etc/test_etc.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
index 8fb3b485a3..c4db71cdf4 100644
--- a/test/etc/test_etc.rb
+++ b/test/etc/test_etc.rb
@@ -38,7 +38,9 @@ class TestEtc < Test::Unit::TestCase
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 @@ class TestEtc < Test::Unit::TestCase
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))