summaryrefslogtreecommitdiff
path: root/spec/ruby/library/etc/struct_group_spec.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-20 11:14:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-20 11:14:08 +0000
commitf194979baec7d84b31d054813cff0e3ec80dc29c (patch)
tree6da24c8a15e8ffe2bd07b26549ea8238b1dfa223 /spec/ruby/library/etc/struct_group_spec.rb
parent07a5e55f1126695457353cde5f7aeceec6cff07a (diff)
skip when group name is not found
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/library/etc/struct_group_spec.rb')
-rw-r--r--spec/ruby/library/etc/struct_group_spec.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/ruby/library/etc/struct_group_spec.rb b/spec/ruby/library/etc/struct_group_spec.rb
index 030692116a..0b50ff578f 100644
--- a/spec/ruby/library/etc/struct_group_spec.rb
+++ b/spec/ruby/library/etc/struct_group_spec.rb
@@ -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