lib/Shell/Amazon/S3/Command/user.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 25 SCAR 6.9
CC
1
Cov
0%
execute
2.0
BEGIN
2.0
CRAP 2.0
1 package Shell::Amazon::S3::Command::user;
2 use Moose;
3  
4 extends 'Shell::Amazon::S3::Command';
5  
6 override 'validate_tokens', sub {
7 my ( $self, $tokens ) = @_;
8 if( @{$tokens} != 1) {
9 return (0, "error: user <aws access key id>");
10 }
11 return ( 1, "" );
12 };
13  
14 override 'parse_tokens', sub {
15 my ( $self, $tokens ) = @_;
16 my $args = {};
17 $args->{aws_access_key_id} = $tokens->[0];
18 $args;
19 };
20  
21 sub execute {
22 my ( $self, $args ) = @_;
23 my $config_loader = Shell::Amazon::S3::ConfigLoader->instance;
24 $config_loader->update( 'aws_access_key_id', $args->{aws_access_key_id} );
25  
26 $self->setup_api;
27 return 'Updated accecc key id';
28 }
29  
30 1;