Catmandu-Importer-getJSON

 view release on metacpan or  search on metacpan

t/10_import.t  view on Meta::CPAN

use strict;
use Test::More;
use lib 't';
use MockFurl;
use Catmandu::Importer::getJSON;

sub test_importer(@) { ##no critic
    my ($url, $requests, $content, $expect, $msg) = @_;

    my $importer = Catmandu::Importer::getJSON->new(
        file => \ do { join "\n", map { $_->[0] } @$requests },
        client => MockFurl::new( content => $content ),
    );
    $importer->url($url) if defined $url;

    $expect = [ map { $expect } @$requests ] if ref $expect ne 'ARRAY';
    is_deeply $importer->to_array, $expect, $msg;



( run in 0.286 second using v1.01-cache-2.11-cpan-1f129e94a17 )