# Test-Stub **Repository Path**: mirrors_gitpan/Test-Stub ## Basic Information - **Project Name**: Test-Stub - **Description**: Read-only release history for Test-Stub - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-10-20 - **Last Updated**: 2025-10-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README NAME Test::Stub - Stub! Stub! Stub! SYNOPSIS use Test::Stub; # DSL style my $agent = LWP::UserAgent->new(); stub($agent)->get(HTTP::Response->new(200, "OK")); is($agent->get('http://www.aiseikai.or.jp/')->code, 200); # simple style my $agent = LWP::UserAgent->new(); make_stub($agent, 'get', HTTP::Response->new(200, "OK")); is($agent->get('http://www.aiseikai.or.jp/')->code, 200); DESCRIPTION Test::Stub is a simple stubbing library for Perl5. EXPORTABLE FUNCTIONS stub($stuff) : Test::Stub::Driver Create a new instance of Test::Stub::Driver. make_stub($object, $method, $stub) : Undef Make monadic class from blessed($object) and add a $method with $stub. Test::Stub::Driver This class only provides a AUTOLOAD method. AUTOLOAD method rebless the $stuff to anonymous class. For example. After calling following code: stub($stuff)->foo('bar'); "$stuff->foo()" returns 'bar'. AUTHOR Tokuhiro Matsuno SEE ALSO The interface was taken from Test::Double. LICENSE Copyright (C) Tokuhiro Matsuno This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.