lib/App/MadEye/Plugin/Check/User.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 27 CC 2 SCAR 12.0
CC
2
Cov
0%
check
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 3.3
1 package App::MadEye::Plugin::Check::User;
2 use strict;
3 use warnings;
4 use base qw/Class::Component::Plugin/;
5 use POSIX qw(getuid getpwuid);
6  
7 sub check :Hook {
8 my ($self, $context, $args) = @_;
9  
10 my $user = $self->config->{config}->{user};
11  
12 my @pw = getpwuid getuid;
13 my $current_user = $pw[0];
14 if ($current_user ne $user) {
15 die "this script must run by $user user!(not $current_user)";
16 }
17 }
18  
19 1;
20 __END__