mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
process.c: fix rubyspec of Process.groups
getgroups(2) may return a GID list that includes duplicated GIDs. The behavior is totaly depends on what OS is used. This commit fixes the example of Process.groups so that the example is independent of this OS-dependent features. Additonaly, this commit adds the description of such system-dependent characteristics of Process.groups. [ruby-dev:50603] [Bug #14969] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6c70fede0c
commit
c0d1a46fc3
2 changed files with 15 additions and 2 deletions
|
@ -6,8 +6,8 @@ describe "Process.groups" do
|
|||
groups = `id -G`.scan(/\d+/).map { |i| i.to_i }
|
||||
gid = Process.gid
|
||||
|
||||
expected = (groups.sort - [gid]).sort
|
||||
actual = (Process.groups - [gid]).sort
|
||||
expected = (groups.sort - [gid]).uniq.sort
|
||||
actual = (Process.groups - [gid]).uniq.sort
|
||||
actual.should == expected
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue