diff options
Diffstat (limited to 'spec/ruby/core/process/groups_spec.rb')
| -rw-r--r-- | spec/ruby/core/process/groups_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/core/process/groups_spec.rb b/spec/ruby/core/process/groups_spec.rb index cbbe4fed25..fa916671a4 100644 --- a/spec/ruby/core/process/groups_spec.rb +++ b/spec/ruby/core/process/groups_spec.rb @@ -4,6 +4,10 @@ describe "Process.groups" do platform_is_not :windows do it "gets an Array of the gids of groups in the supplemental group access list" do groups = `id -G`.scan(/\d+/).map { |i| i.to_i } + # Include the standard `id` command output. On macOS, GNU + # coreutils `id` is limited to NGROUPS_MAX groups, because of + # the backward compatibility of getgroups(2). + (groups |= `/usr/bin/id -G`.scan(/\d+/).map { |i| i.to_i }) rescue nil gid = Process.gid expected = (groups.sort - [gid]).uniq.sort @@ -46,7 +50,7 @@ describe "Process.groups=" do Process.groups.should == [ Process.gid ] supplementary = groups - [ Process.gid ] if supplementary.length > 0 - -> { Process.groups = supplementary }.should raise_error(Errno::EPERM) + -> { Process.groups = supplementary }.should.raise(Errno::EPERM) end end end @@ -55,7 +59,7 @@ describe "Process.groups=" do it "raises Errno::EPERM" do -> { Process.groups = [0] - }.should raise_error(Errno::EPERM) + }.should.raise(Errno::EPERM) end end end |
