01 May 2019 07:19:54 UTC
- Distribution: Furl-PSGI
- Module version: 0.03
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Testers (84 / 0 / 0)
- KwaliteeBus factor: 0
- 88.89% Coverage
- License: perl_5
- Perl: v5.8.0
- Activity24 month
- Download (11.09KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionMHOWARD Meredith Howard
Why not adopt me?This distribution is up for adoption! If you're interested then please contact the PAUSE module admins via email.
Furl::PSGI - Furl, but wired to a PSGI app
use Furl::PSGI; my $furl = Furl::PSGI->new( app => $my_app, # ... any other supported Furl options ); # Request is passed to $my_app and nowhere else my $res = $furl->get('https://foo.baz/any/url');
Furl::PSGI is a subclass of Furl that requires a PSGI app and sends all requests through that app. This helps facilitate testing, where you can pass a Furl::PSGI rather than a Furl and handle any requests in the same process rather than go out over the network with real requests.
Furl::PSGI is a Furl
There are already modules that do this for LWP and kin for testing, and those can sort of drop in for Furl if you're careful how you use them, but it's still not Furl. There are slight differences in making requests and dealing with responses. I wanted to get a PSGI-connected Furl with no gotchas.
There are also modules like Test::TCP which let you start a process listening on a free localhost port, but it involves forking a process to run your PSGI app in, and that can make a mess of test harnesses that don't handle it.
Meredith Howard <email@example.com>
This software is copyright (c) 2019 by Meredith Howard.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.