Branch Coverage

blib/lib/Test/Mock/LWP/Distilled.pm
Criterion Covered Total %
branch 29 34 85.2


line true false branch
547 0 28 unless $package
548 14 14 if ($subroutine eq ref($self) . '::new')
565 0 11 unless $self->base_dir
572 8 3 if ($self->file_name_from_calling_class) { }
587 9 2 if (@additional_file_paths)
615 5 5 if ($self->mode eq 'record')
621 1 4 unless (-e $self->mock_filename)
627 0 4 unless open my $fh, '<:encoding(UTF-8)', $self->mock_filename
635 1 3 unless eval { do { $json_data = $jsonifier->decode($json); 1 } }
640 1 2 if (ref $json_data ne 'ARRAY')
644 1 1 if (grep {not exists $_->{'distilled_response'} unless ref $_ ne 'HASH' or not exists $_->{'distilled_request'};} @$json_data)
649 3 1 unless ref $_ ne 'HASH' or not exists $_->{'distilled_request'}
665 11 3 unless $self->mode eq 'record' and @{$self->mocks;}
668 1 2 unless open my $fh, '>:encoding(UTF-8)', $self->mock_filename
674 1 1 unless eval { do { $json = $jsonifier->encode($self->mocks); 1 } }
676 0 1 unless print $fh $json
680 0 1 unless close $fh