summaryrefslogtreecommitdiff
path: root/test/etc
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-18 15:34:46 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-18 15:34:46 +0000
commit33e5cfee7b90ec800e4546c6a0c0a73c2a66d73c (patch)
treede911d8c8c3553ec6661dc627cfebefd843de9d1 /test/etc
parent87d053f0002ebf9a3927412a85ea0a09bd06f705 (diff)
* test/etc/test_etc.rb: avoid infinite loop. [ruby-dev:35158]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/etc')
-rw-r--r--test/etc/test_etc.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
index 5725569..48a17ff 100644
--- a/test/etc/test_etc.rb
+++ b/test/etc/test_etc.rb
@@ -28,14 +28,18 @@ class TestEtc < Test::Unit::TestCase
end
def test_getpwuid
- Etc.passwd do |s|
+ passwd = []
+ Etc.passwd {|s| passwd << s }
+ passwd.each do |s|
assert_equal(s, Etc.getpwuid(s.uid))
assert_equal(s, Etc.getpwuid) if Etc.getlogin == s.name
end
end
def test_getpwnam
- Etc.passwd do |s|
+ passwd = []
+ Etc.passwd {|s| passwd << s }
+ passwd.each do |s|
assert_equal(s, Etc.getpwnam(s.name))
end
end