API-DeutscheBahn-Fahrplan

 view release on metacpan or  search on metacpan

t/01_main.t  view on Meta::CPAN

        throws_regex => qr/Missing query parameter: date/,
    }
);

for (@uri_tests) {

    my ( $method, %params ) = ( $_->{method}, %{ $_->{params} } );

    if ( $_->{throws} ) {
        throws_ok { $fahrplan_free->_create_uri( $method, %params ) }
        $_->{throws_regex}, 'error thrown successfully'
            and next;
    }

    my ( undef, $uri ) = $fahrplan_free->_create_uri( $method, %params );

    is $uri->scheme, 'https', 'uri scheme set to https';
    is $uri->host, 'api.deutschebahn.com', 'uri host set';

    like $uri->path_query, $_->{regex},
        sprintf 'successfully created uri for %s', $method;



( run in 0.587 second using v1.01-cache-2.11-cpan-65fba6d93b7 )