blib/lib/Metabase/Test/Archive/Null.pm untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 48 CC 2 SCAR 9.8
CC
2
Cov
0%
store
6.0
initialize
2.0
extract
2.0
CRAP 2.7
1 use 5.006;
2 use strict;
3 use warnings;
4  
5 package Metabase::Test::Archive::Null;
6 # ABSTRACT: Metabase storage that discards all data
7 our $VERSION = '1.003'; # VERSION
8  
9 use Moose;
10  
11 use Carp ();
12 use Data::Stream::Bulk::Nil;
13  
14 with 'Metabase::Archive';
15  
16 sub initialize { }
17  
18 # given fact, discard it and return guid
19 sub store {
20 my ($self, $fact_struct) = @_;
21  
22 my $guid = $fact_struct->{metadata}{core}{guid};
23 unless ( $guid ) {
24 Carp::confess "Can't store: no GUID set for fact\n";
25 }
26  
27 # do nothing except return
28 return $guid;
29 }
30  
31 # we discard, so can't ever extract
32 sub extract {
33 die "unimplemented";
34 }
35  
36 # does nothing
37 sub delete {
38 my ($self, $guid) = @_;
39 return $guid;
40 }
41  
42 # we have nothing to return
43 sub iterator {
44 return Data::Stream::Bulk::Nil->new;
45 }
46  
47 1;
48  
49 __END__