blib/lib/Metabase/Test/Factory.pm

filter: Statementstmt 100% 35 / 35 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 45 / 45 CC 2 SCAR 1.7
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Metabase/Test/Index.pm ↑ Summary blib/lib/Metabase/Archive.pm »
1 2 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 package Metabase::Test::Factory;
6 # ABSTRACT: Test::Routine role for testing Metabase::Index implementations
7 2 our $VERSION = '1.003'; # VERSION
8  
9 2 ▶use Metabase::Fact;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Metabase::Test::Fact;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 2 ▶use MooseX::Types::Moose qw/Str ClassName/;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶use MooseX::Types::Structured qw/Map/;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 #--------------------------------------------------------------------------#
18 # fixtures
19 #--------------------------------------------------------------------------#
20  
21 2 my $dist_id = 'cpan:///distfile/UNKNOWN/Foo-Bar-1.23.tar.gz';
22 2 my %fact_content = (
23 fact1 => "Hello World",
24 fact2 => "Everything is fine",
25 );
26  
27 has test_fact => (
28 traits => ['Hash'],
29 is => 'ro',
30 isa => Map[Str, class_type('Metabase::Test::Fact')],
31 2 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
32 2 my %hash;
33 2 for my $k ( keys %fact_content ) {
34 $hash{$k} = Metabase::Test::Fact->new(
35 resource => $dist_id,
36 4 content => $fact_content{$k},
37 );
38 };
39 2 return \%hash;
40 },
41 2 handles => {
42 get_test_fact => 'get',
43 keys_test_fact => 'keys',
44 },
45 );
46  
47 2 1;
48  
49 __END__
« blib/lib/Metabase/Test/Index.pm ↑ Summary blib/lib/Metabase/Archive.pm »