Branch Coverage

blib/lib/App/Presto/Config.pm
Criterion Covered Total %
branch 16 24 66.6


line true false branch
24 1 1 unless (-e $config_file)
26 0 1 unless open my $fh, '>', $config_file
34 0 2 unless open my $fh, '<', $config_file
38 0 2 unless (eval { do { local $/; die "Unable to open $config_file for reading: $!" unless open my $fh, '<', $config_file; my $json_text = <$fh>; $config = &decode_json(scalar($json_text || '{}')); 1 } })
54 3 3 unless (-d $dir)
76 2 2 if ($key eq 'endpoint')
79 1 1 if (not defined $value) { }
87 0 2 unless (eval { do { $self->write_config; 1 } })
100 1 2 if $key eq 'endpoint'
101 2 0 exists $self->config->{$key} ? :
112 0 2 unless open my $fh, '>', $config_file
126 0 0 unless ($self->is_set($k))