diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-10 05:18:03 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-10 05:18:03 +0000 |
commit | c0d1a46fc3549340ccd4af8fbd0b491de4ea421d (patch) | |
tree | a4504d184815066ee4d6580b85c9249071276191 /spec/ruby/core/process/groups_spec.rb | |
parent | 6c70fede0c1fce37f7586d959b853df2bdbfff5f (diff) | |
download | ruby-c0d1a46fc3549340ccd4af8fbd0b491de4ea421d.tar.gz |
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
Diffstat (limited to 'spec/ruby/core/process/groups_spec.rb')
-rw-r--r-- | spec/ruby/core/process/groups_spec.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/ruby/core/process/groups_spec.rb b/spec/ruby/core/process/groups_spec.rb index 331c53939a..325deb5977 100644 --- a/spec/ruby/core/process/groups_spec.rb +++ b/spec/ruby/core/process/groups_spec.rb @@ -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 |