blib/lib/App/Prove/Plugin/SetEnv.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 11 | 11 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 3 | 3 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 14 | 15 | 93.3 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package App::Prove::Plugin::SetEnv; | ||||||
2 | { | ||||||
3 | $App::Prove::Plugin::SetEnv::VERSION = '0.001'; | ||||||
4 | } | ||||||
5 | |||||||
6 | # ABSTRACT: a prove plugin to set environment variables | ||||||
7 | |||||||
8 | 1 | 1 | 132690 | use strict; | |||
1 | 3 | ||||||
1 | 35 | ||||||
9 | 1 | 1 | 18 | use warnings; | |||
1 | 2 | ||||||
1 | 129 | ||||||
10 | |||||||
11 | sub load { | ||||||
12 | 1 | 1 | 0 | 4335 | my ($class, $p) = @_; | ||
13 | 1 | 2 | foreach my $arg (@{$p->{args}}) { | ||||
1 | 4 | ||||||
14 | 2 | 7 | my ($var, $val) = split '=', $arg, 2; | ||||
15 | 2 | 18 | $ENV{$var} = $val; | ||||
16 | } | ||||||
17 | } | ||||||
18 | |||||||
19 | |||||||
20 | 1; | ||||||
21 | |||||||
22 | __END__ |