summaryrefslogtreecommitdiff
path: root/test/etc
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 15:02:22 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-03 15:02:22 +0000
commitc309cda9037be78e835bd07cf1f2dba0c22f3653 (patch)
treeeda24f9777272486563ccbf7ff6974a80b894f24 /test/etc
parent1f322f83e7c3d21c73a744f53a04c3463765b12d (diff)
* test/etc/test_etc.rb (test_getpwuid, test_getgrgid): use
Process.euid and egid instead of Etc.getlogin to identify current user which may be different from a login one (e.g., su command). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/etc')
-rw-r--r--test/etc/test_etc.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/etc/test_etc.rb b/test/etc/test_etc.rb
index 7129619..add7d63 100644
--- a/test/etc/test_etc.rb
+++ b/test/etc/test_etc.rb
@@ -32,7 +32,7 @@ class TestEtc < Test::Unit::TestCase
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
+ assert_equal(s, Etc.getpwuid) if Process.euid == s.uid
end
end
@@ -73,7 +73,7 @@ class TestEtc < Test::Unit::TestCase
end
groups.each do |s|
assert_equal(s, Etc.getgrgid(s.gid))
- assert_equal(s, Etc.getgrgid) if Etc.getlogin == s.name
+ assert_equal(s, Etc.getgrgid) if Process.egid == s.gid
end
end