1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Test both username and uid

* system(, uid: ) takes username or uid
* ENV["USER"] may be nil (sudo or jail)

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2012-10-10 08:08:22 +00:00
parent f784e14fce
commit ba7c9b1cf7

View file

@ -1482,9 +1482,18 @@ class TestProcess < Test::Unit::TestCase
feature6975 = '[ruby-core:47414]'
[30000, [ENV["USER"], Process.uid]].each do |user, uid|
if user
assert_nothing_raised(feature6975) do
begin
system(*TRUECOMMAND, uid: user)
rescue Errno::EPERM, NotImplementedError
end
end
end
assert_nothing_raised(feature6975) do
begin
system(*TRUECOMMAND, uid: user)
system(*TRUECOMMAND, uid: uid)
rescue Errno::EPERM, NotImplementedError
end
end