line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mojo::Role::Debug::JSON; |
2
|
|
|
|
|
|
|
$Test::Mojo::Role::Debug::JSON::VERSION = '0.003'; |
3
|
|
|
|
|
|
|
# ABSTRACT: a JSON extension to Test::Mojo::Role::Debug |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1724
|
use Mojo::Base -role; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
with 'Test::Mojo::Role::Debug'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
642
|
use Carp qw/croak/; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
80
|
|
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
9
|
use Mojo::JSON qw{from_json}; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
56
|
|
12
|
1
|
|
|
1
|
|
9
|
use Test::More (); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
250
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
# VERSION |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub djson { |
17
|
3
|
|
|
3
|
1
|
49012
|
my ( $self ) = @_; |
18
|
3
|
100
|
|
|
|
16
|
return $self->success ? $self : $self->djsona; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub djsona { |
22
|
3
|
|
|
3
|
1
|
23239
|
my ( $self ) = @_; |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
10
|
local $@; |
25
|
3
|
|
|
|
|
9
|
my $json = eval { from_json( $self->tx->res->content->asset->slurp ) }; |
|
3
|
|
|
|
|
14
|
|
26
|
|
|
|
|
|
|
|
27
|
3
|
50
|
|
|
|
717
|
Test::More::diag( $@ ) if $@; |
28
|
3
|
50
|
|
|
|
29
|
Test::More::diag( "DEBUG JSON DUMPER:\n", Test::More::explain( $json ) ) if ref $json; |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
1334
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |