App-CPANCoverBadge

 view release on metacpan or  search on metacpan

t/MyTestUA.pm  view on Meta::CPAN


</tbody>
</table>

</body>
</html>



@@ does-not-exist.response
HTTP/1.1 404 Not Found
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 19 Dec 2018 18:54:51 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
ETag: W/"571b65cf-943"

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
    <meta http-equiv="Content-Language" content="en-us"></meta>
    <link rel="stylesheet" type="text/css" href="/latest/collection.css"></link>
    <title>404</title>
  </head>
  <body>

    <h1>Oops!</h1>

    <p>You have managed to reach a page that doesn't exist.</p>

    <p><i>Just think about that for a moment!.</i></p>

    <p>This may be because:</p>

t/MyTestUA.pm  view on Meta::CPAN

</tr>


</tbody>
</table>

</body>
</html>

@@ invalid.response
HTTP/1.1 404 Not Found
Server: nginx/1.10.3 (Ubuntu)
Date: Wed, 19 Dec 2018 18:54:51 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
ETag: W/"571b65cf-943"

<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
    <meta http-equiv="Content-Language" content="en-us"></meta>
    <link rel="stylesheet" type="text/css" href="/latest/collection.css"></link>
    <title>404</title>
  </head>
  <body>

    <h1>Oops!</h1>

    <p>You have managed to reach a page that doesn't exist.</p>

    <p><i>Just think about that for a moment!.</i></p>

    <p>This may be because:</p>

t/get_cpancover_rating.t  view on Meta::CPAN

use lib dirname(__FILE__);
use MyTestUA;

use App::CPANCoverBadge;

my $badger = App::CPANCoverBadge->new( ua => MyTestUA->new, sql => 1 );
isa_ok $badger, 'App::CPANCoverBadge';

my %tests = (
    'red' => {
        code  => 404,
        value => '22.0',
    },
    'types-reneeb' => {
        code  => 200,
        value => '100.0',
    },
    'does-not-exist' => {
        code  => 404,
        value => undef,
    },
);

for my $dist ( sort keys %tests ) {
    my $value = $badger->_get_cpancover_rating( $dist );
    is $value, $tests{$dist}->{value}, $dist;
}




( run in 1.747 second using v1.01-cache-2.11-cpan-39bf76dae61 )