develooper Front page | perl.module-authors | Postings from October 2005

Re: Tests needing user parameters

Thread Previous | Thread Next
From:
Jess Robinson
Date:
October 20, 2005 01:11
Subject:
Re: Tests needing user parameters
Message ID:
Pine.LNX.4.58.0510200909170.12736@insel.m.isar.de


On Wed, 19 Oct 2005, Ken Williams wrote:

> 
> On Oct 19, 2005, at 4:50 PM, Jess Robinson wrote:
> 
> > My module will login to a web service and manipulate data
> > programmatically.. Nothing critical I assure you, just a tool ;) Since
> > theres no dummy/test account that I know of, I'll need the users
> > account/email address and password to login.
> 
> Typically you'd add some code to the Makefile.PL or Build.PL that asks the
> user for a username/password to use for testing, and gives the user an option
> to skip those tests.  DBI modules often do this, for example (where the
> username/password is for a database to access).
> 
> If you're using ExtUtils::MakeMaker, you'll have to find some file to stash
> the information, probably somewhere in t/ .  If you're using Module::Build,
> have a look at the notes() method, which is for caching this kind of
> information.

Right, I'd seen a few modules do this, but.. Is there a *standard* way of 
doing it? Those Makefile.PLs tend to look cluttered and confusing IMO.. a 
nice:

use Test::Auth; 
get_user_fields("user", "password");

would be preferable.. (hmmm, could write something that does that, using 
IO::Prompt.. anyone interested?)

Jess


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About