Skip to content

Commit 20cfd07

Browse files
committed
Handle no supplementary groups in grpowned? specs
1 parent 7022325 commit 20cfd07

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

spec/ruby/shared/file/grpowned.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@
2121
it 'takes non primary groups into account' do
2222
group = (Process.groups - [Process.egid]).first
2323

24-
File.chown(nil, group, @file)
24+
if group
25+
File.chown(nil, group, @file)
2526

26-
@object.send(@method, @file).should == true
27+
@object.send(@method, @file).should == true
28+
else
29+
# No supplementary groups
30+
1.should == 1
31+
end
2732
end
2833
end
2934

0 commit comments

Comments
 (0)