Skip to content

Commit 290e36a

Browse files
andrykonchineregon
authored andcommitted
Fix executable? and executable_real? file permissions predicates
1 parent 78b5d86 commit 290e36a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/mspec/guards/superuser.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ def match?
66
end
77
end
88

9+
class RealSuperUserGuard < SpecGuard
10+
def match?
11+
Process.uid == 0
12+
end
13+
end
14+
915
def as_superuser(&block)
1016
SuperUserGuard.new.run_if(:as_superuser, &block)
1117
end
1218

19+
def as_real_superuser(&block)
20+
RealSuperUserGuard.new.run_if(:as_real_superuser, &block)
21+
end
22+
1323
def as_user(&block)
1424
SuperUserGuard.new.run_unless(:as_user, &block)
1525
end

0 commit comments

Comments
 (0)