File/Config.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 9 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 43 CC 1 SCAR 6.9
CC
1
Cov
0%
_build_dir
2.0
_build_content
2.0
BEGIN
2.0
CRAP 2.0
1 package Sweet::File::Config;
2 use latest;
3 use Moose;
4  
5 use Carp;
6 use MooseX::AttributeShortcuts;
7 use Sweet::HomeDir;
8 use YAML;
9 use namespace::autoclean;
10  
11 extends 'Sweet::File';
12  
13 sub _build_dir { Sweet::HomeDir->new }
14  
15 has content => (
16 is => 'lazy',
17 isa => 'HashRef',
18 );
19  
20 sub _build_content {
21 my $self = shift;
22  
23 my $path = $self->path;
24  
25 my $content = YAML::LoadFile( $path )
26 or croak "Cannot load YAML file $path\n";
27  
28 return $content;
29 }
30  
31 __PACKAGE__->meta->make_immutable;
32  
33 __END__