App-ReportPrereqs

 view release on metacpan or  search on metacpan

xt/url.t  view on Meta::CPAN

use lib File::Spec->catdir( File::Basename::dirname( Cwd::abs_path __FILE__ ), '../corpus/lib' );

require_ok('bin/report-prereqs') or BAIL_OUT();

note(q{download file from invalid url});
SKIP:
{
    my $res = {
        'success' => q{},
        'headers' => {
            'content-type'   => 'text/plain',
            'content-length' => 76,
        },
        'content' => "Could not connect to 'no.such.url:80': node name or service name not known\n",
        'url'     => 'http://no.such.url./cpanfile',
        'reason'  => 'Internal Exception',
        'status'  => 599,
    };

    my $module = Test::MockModule->new('HTTP::Tiny');
    $module->redefine( 'get', sub { return $res; } );

xt/url.t  view on Meta::CPAN

            'connection'                  => 'keep-alive',
            'accept-ranges'               => 'bytes',
            'content-length'              => '7840',
            'x-xss-protection'            => '1; mode=block',
            'expires'                     => 'Thu, 07 Jun 2018 20:20:24 GMT',
            'x-timer'                     => 'S1528402525.672062,VS0,VE96',
            'content-security-policy'     => 'default-src \'none\'; style-src \'unsafe-inline\'; sandbox',
            'x-cache'                     => 'MISS',
            'x-fastly-request-id'         => 'a46d6b434a76506ced7a5caf7ef0ff54e70b6569',
            'via'                         => '1.1 varnish',
            'content-type'                => 'text/plain; charset=utf-8',
            'x-cache-hits'                => '0',
            'etag'                        => '"b82620b2b61a7275fc1d0ad1bc9a405a00dba9c1"',
            'x-content-type-options'      => 'nosniff',
        },
    };

    my $module = Test::MockModule->new('HTTP::Tiny');
    $module->redefine( 'get', sub { return $res; } );

    local @ARGV = ('https://raw.githubusercontent.com/skirmess/App-ReportPrereqs/master/cpanfile');

    my ( $stdout, $stderr, @result ) = capture { App::ReportPrereqs::_main() };
    is( $result[0], undef, '_main() returns undef' );



( run in 1.783 second using v1.01-cache-2.11-cpan-524268b4103 )