File Coverage

blib/lib/JMAP/Tester/Result/Download.pm
Criterion Covered Total %
statement 8 9 88.8
branch n/a
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 11 14 78.5


line stmt bran cond sub pod time code
1 2     2   20 use v5.20.0;
  2         5  
2              
3             package JMAP::Tester::Result::Download 0.110;
4             # ABSTRACT: what you get when you download a blob
5              
6 2     2   8 use Moo;
  2         2  
  2         8  
7             with 'JMAP::Tester::Role::HTTPResult';
8              
9 2     2   547 use namespace::clean;
  2         49  
  2         10  
10              
11             #pod =head1 OVERVIEW
12             #pod
13             #pod A JMAP::Tester::Result::Download object represents the successful download of a
14             #pod JMAP blob. It is a successful L, meaning it
15             #pod has a C method that returns an L object.
16             #pod
17             #pod =method bytes_ref
18             #pod
19             #pod The raw bytes of the blob.
20             #pod
21             #pod It also has a C method which will return a reference to the
22             #pod raw bytes of the download.
23             #pod
24             #pod =cut
25              
26 0     0 0   sub is_success { 1 }
27              
28             has bytes_ref => (
29             is => 'ro',
30             lazy => 1,
31             default => sub {
32             my $str = $_[0]->http_response->decoded_content(charset => 'none');
33             return \$str;
34             },
35             );
36              
37             1;
38              
39             __END__