NAME
Test::Mock::Furl - Mocks Furl for testing
SYNOPSIS
use Test::More;
use Test::Mock::Furl;
use Furl;
use Furl::Request;
$Mock_furl->mock(request => sub { Furl::Response->new } );
$Mock_furl_res->mock(message => sub { 'ok ok ok' } );
my $req = Furl::Request->new('GET' => 'http://example.com/');
my $furl = Furl->new;
my $res = $furl->request($req);
ok $res->is_success;
is $res->code, 200;
is $res->content, '';
is $res->message, 'ok ok ok';
done_testing;
DESCRIPTION
Test::Mock::Furl
is the mock module for teting Furl
EXPORTS
The following variables are exported by default:
- $Mock_furl
-
The mock Furl object - a Test::MockObject object
- $Mock_furl_req, $Mock_furl_request
-
The mock Furl::Request object - a Test::MockObject object
- $Mock_furl_res, $Mock_furl_response
-
The mock Furl::Response object - a Test::MockObject object
REPOSITORY
Test::Mock::Furl is hosted on github <http://github.com/bayashi/Test-Mock-Furl>
Welcome your patches and issues :D
AUTHOR
Dai Okabayashi <bayashi@cpan.org>
SEE ALSO
The code of this module was almost copied from Test::Mock::LWP.
LICENSE
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.