Skip Menu |

This queue is for tickets about the Test-Mock-LWP CPAN distribution.

Report information
The Basics
Id: 25469
Status: resolved
Worked: 1 hour (60 min)
Priority: 0/
Queue: Test-Mock-LWP

People
Owner: mcmahon [...] cpan.org
Requestors: dcantrell [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.04
Fixed in: (no value)



Subject: please add a HOWTO to the docs!
It's not at all clear how to use this module. I have a module which (partly) wraps around LWP::UserAgent which I use to fetch data which my module then manipulates. Obviously I need to test that my module handles webby errors correctly, for instance that it correctly detects when the remote sites don't respond; and I need to be able to feed known data to my module so I can test that it does those manipulations correctly. Test::Mock::LWP is the obvious candidate for faking up LWP::UserAgent, but I just can't figure out how to use it. Please can you write a HOWTO and add it to the docs.
I have a problem understanding purpose of this module. Can it be used to test LWP-based program or it is used to test LWP itself? -- Alexandr Ciornii, http://chorny.net
On Wed Aug 13 15:01:18 2008, CHORNY wrote: Show quoted text
> I have a problem understanding purpose of this module. Can it be used to > test LWP-based program or it is used to test LWP itself? >
It's used to mock out LWP, for testing code that uses LWP, but doesn't want to make real LWP calls. See the Test-WWW-Selenium unit tests (which is what I wrote the module for): http://search.cpan.org/src/LUKEC/Test-WWW-Selenium-1.15/t/test-selenium.t Patches (including HOWTO patches) welcome.
Very belatedly, I've created a HOWTO and a couple sample scripts that illustrate how the module should be used.
HOWTO and a couple example scripts to clarify added in the next release.