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

skip when group name is not found

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-06-20 11:14:08 +00:00
parent 07a5e55f11
commit f194979bae
2 changed files with 10 additions and 2 deletions

View file

@ -13,10 +13,14 @@ end
# TODO: verify these on non-windows, non-darwin OS
platform_is_not :windows do
grpname = IO.popen(%w'id -gn', err: IO::NULL, &:read)
next unless $?.success?
grpname.chomp!
describe "Etc.getgrgid" do
before :all do
@gid = `id -g`.strip.to_i
@name = `id -gn`.strip
@name = grpname
end
it "returns a Etc::Group struct instance for the given user" do

View file

@ -3,12 +3,16 @@ require 'etc'
describe "Struct::Group" do
platform_is_not :windows do
grpname = IO.popen(%w'id -gn', err: IO::NULL, &:read)
next unless $?.success?
grpname.chomp!
before :all do
@g = Etc.getgrgid(`id -g`.strip.to_i)
end
it "returns group name" do
@g.name.should == `id -gn`.strip
@g.name.should == grpname
end
it "returns group password" do