GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MOCKED (3)

.ds Aq ’

NAME

mocked - use mocked libraries in unit tests

CONTENTS

SYNOPSIS



  # use a fake LWP::Simple for testing from t/lib/LWP/Simple.pm
  use mocked LWP::Simple;
  my $text = get($url);

  # use a fake WWW::Mechanize for testing from t/mock-libs/WWW/Mechanize.pm
  use mocked [qw(WWW::Mechanize t/mock-libs)];



DESCRIPTION

Often during unit testing, you may find the need to use mocked libraries to test edge cases, or prevent unit tests from using slow or external code.

This is where mocking libraries can help.

When you mock a library, you are creating a fake one that will be used in place of the real one. The code can do as much or as little as is needed.

Use mocked.pm as a safety measure (be sure you’re actually using the mocked module), and as a way to document the tests for future maintainers.

VARIABLES

    real_inc_paths

The real @INC that we are over-ridding is stored here while we are loading the mocked library.

FUNCTIONS

    import

With a package name, this function will ensure that the module you specify is loaded from t/lib.

You can also pass an array reference containing the package name and a directory from which to load it from.

AUTHOR

Luke Closs, <cpan at 5thplane.com> Scott McWhirter, <kungfuftr at cpan.org>

MAD CREDS TO

Ingy doet net, for only.pm

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 112: Non-ASCII character seen before =encoding in ’doet’. Assuming UTF-8
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MOCKED (3) 2007-12-11

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.