summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-29 04:21:32 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-29 04:21:32 +0000
commitf783b8d204e4124f1c7be9c92e6289aeb971b8a5 (patch)
tree7f32f97f6102e7054d277127a9da5cf5105dccf7 /test
parente7d2f303b737a33b99c9f93a093dad029bc1c24e (diff)
* test/etc/test_etc.rb (test_getpwuid): fix for users whose uid is
shared. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/etc/test_etc.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
index 48a17ff4bf..29e5f0bed2 100644
--- a/test/etc/test_etc.rb
+++ b/test/etc/test_etc.rb
@@ -28,9 +28,9 @@ class TestEtc < Test::Unit::TestCase
end
def test_getpwuid
- passwd = []
- Etc.passwd {|s| passwd << s }
- passwd.each do |s|
+ passwd = {}
+ Etc.passwd {|s| passwd[s.uid] = s unless passwd[s.uid] }
+ passwd.values.each do |s|
assert_equal(s, Etc.getpwuid(s.uid))
assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name
end