KiokuDB/Test/Fixture/RootSet.pm

filter: Statementstmt 100% 67 / 67 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 15 / 15 Podpod 0.0% 0 / 3 totaltotal 96.4% 82 / 85 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« KiokuDB/Test/Fixture/Unicode.pm ↑ Summary KiokuDB/Test/Fixture/SimpleSearch.pm »
1 #!/usr/bin/perl
2  
3 package KiokuDB::Test::Fixture::RootSet;
4 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Test::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶use KiokuDB::Test::Person;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use KiokuDB::Test::Company;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 with qw(KiokuDB::Test::Fixture) => { excludes => 'sort' };
15  
16 12 ▶sub sort { -50 }
Subroutine sort: called CC=1 SCAR=0.0
Pod undocumented
17  
18 sub create {
19 return (
20 33 ▶ root_person => KiokuDB::Test::Person->new(
Subroutine create: called CC=1 SCAR=0.0
Pod undocumented
21 name => "blah",
22 kids => [ KiokuDB::Test::Person->new( name => "flarp" ) ],
23 ),
24 );
25 }
26  
27 sub verify {
28 33 ▶ my $self = shift;
Subroutine verify: called CC=1 SCAR=0.0
Pod undocumented
29  
30 $self->txn_lives(sub {
31 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
32  
33 33 isa_ok( $p, "KiokuDB::Test::Person" );
34  
35 33 $self->root_ok($p);
36 33 $self->not_root_ok($p->kids->[0]);
37 33 });
38  
39 33 $self->no_live_objects;
40  
41 $self->txn_lives(sub {
42 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
43  
44 33 $self->root_ok($p);
45 33 $self->not_root_ok($p->kids->[0]);
46  
47 25 $p->name("pubar");
48  
49 25 $self->update_ok($p);
50  
51 25 $self->root_ok($p);
52 25 $self->not_root_ok($p->kids->[0]);
53 33 });
54  
55 33 $self->no_live_objects;
56  
57 $self->txn_lives(sub {
58 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
59  
60 33 $self->root_ok($p);
61 33 $self->not_root_ok($p->kids->[0]);
62  
63 25 $self->unset_root($p);
64  
65 25 $self->not_root_ok($p, $p->kids->[0]);
66  
67 25 $self->update_ok($p);
68  
69 25 $self->not_root_ok($p, $p->kids->[0]);
70 33 });
71  
72 33 $self->no_live_objects;
73  
74 $self->txn_lives(sub {
75 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
76  
77 33 $self->not_root_ok($p, $p->kids->[0]);
78  
79 25 $self->set_root($p);
80  
81 25 $self->root_ok($p);
82 25 $self->not_root_ok($p->kids->[0]);
83 33 });
84  
85 33 $self->no_live_objects;
86  
87 $self->txn_lives(sub {
88 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
89  
90 33 $self->not_root_ok($p, $p->kids->[0]);
91  
92 25 $self->set_root($p);
93  
94 25 $self->root_ok($p);
95 25 $self->not_root_ok($p->kids->[0]);
96  
97 25 $self->update_ok($p);
98 33 });
99  
100 33 $self->no_live_objects;
101  
102 $self->txn_lives(sub {
103 33 ▶ my $p = $self->lookup_ok("root_person");
Subroutine __ANON__: called CC=1 SCAR=0.0
104  
105 33 $self->root_ok($p);
106 33 $self->not_root_ok($p->kids->[0]);
107 33 });
108 }
109  
110 2 __PACKAGE__->meta->make_immutable;
111  
112 2 __PACKAGE__
113  
114 __END__
« KiokuDB/Test/Fixture/Unicode.pm ↑ Summary KiokuDB/Test/Fixture/SimpleSearch.pm »