File Coverage

File:lib/OpenAPI/Backend.pm
Coverage:80.8%

linestmtbrancondsubpodtimecode
1package OpenAPI::Backend;
2
3
22
22
22
194
69
168
use strict;
4
22
22
22
228
76
174
use warnings;
5
6sub new {
7
22
0
180
    my ($class, $backend) = @_;
8
22
224
    if (!$backend) {
9
0
0
        die "No backend specified";
10    }
11
22
193
    my $backend_class = $class . '::' . $backend;
12
22
22
22
22
301
93
363
78
    eval "use $backend_class";
13
22
632
    if ($@) {
14
0
0
        die $@;
15    }
16
22
214
    $backend_class->new;
17}
18
191;