File Coverage

blib/lib/Chef/Knife/Cmd/EC2/Server.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 3 0.0
total 20 23 86.9


line stmt bran cond sub pod time code
1             package Chef::Knife::Cmd::EC2::Server;
2 6     6   51 use Moo;
  6         7  
  6         24  
3              
4             has knife => (is => 'ro', required => 1, handles => [qw/handle_options run/]);
5              
6             sub list {
7 1     1 0 669 my ($self, %options) = @_;
8 1         4 my @opts = $self->handle_options(%options);
9 1         4 my @cmd = (qw/knife ec2 server list/, @opts);
10 1         3 $self->run(@cmd);
11             }
12              
13             sub create {
14 1     1 0 457 my ($self, %options) = @_;
15 1         16 my @opts = $self->handle_options(%options);
16 1         4 my @cmd = (qw/knife ec2 server create/, @opts);
17 1         15 $self->run(@cmd);
18             }
19              
20             sub delete {
21 1     1 0 346 my ($self, $nodes, %options) = @_;
22 1         2 my $nodes_str = join " ", @$nodes;
23 1         15 my @opts = $self->handle_options(%options);
24 1         5 my @cmd = (qw/knife ec2 server delete/, $nodes_str, @opts);
25 1         16 $self->run(@cmd);
26             }
27              
28             1;