| 1 | 2 | ▶ | use 5.008; | ||||||||
|
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 Data::Storage::Mock; | ||||||||||
| 6 | 2 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 2 | $Data::Storage::Mock::VERSION = '1.102720'; | |||||||||
| 8 | } | ||||||||||
| 9 | # ABSTRACT: Base class for mock storages | ||||||||||
| 10 | 2 | ▶ | use parent qw(Data::Storage Class::Accessor::Complex); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 2 | __PACKAGE__->mk_scalar_accessors(qw(should_die_on_connect)); | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | sub connect { | ||||||||
|
Subroutine
connect: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 14 | 0 | my $self = shift; | |||||||||
| 15 | 0 | ▶ | $self->die_on_connect if $self->should_die_on_connect; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 16 | } | ||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub die_on_connect { | ||||||||
|
Subroutine
die_on_connect: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 19 | 0 | my $self = shift; | |||||||||
| 20 | 0 | throw Error::Hierarchy::Internal::CustomMessage( | |||||||||
| 21 | custom_message => "can't connect",); | ||||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub disconnect { | ||||||||
|
Subroutine
disconnect: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 25 | 0 | my $self = shift; | |||||||||
| 26 | 0 | ▶ | return unless $self->is_connected; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 27 | 0 | ▶ | $self->rollback_mode ? $self->rollback : $self->commit; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | } | ||||||||||
| 29 | 0 | ▶ | sub is_connected { 1 } | ||||||||
|
Subroutine
is_connected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 30 | 0 | ▶ | sub rollback { } | ||||||||
|
Subroutine
rollback: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 31 | 0 | ▶ | sub commit { } | ||||||||
|
Subroutine
commit: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 32 | 2 | 1; | |||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | __END__ | ||||||||||