Test::FormValidator is a module that makes it easy to test your
Data::FormValidator profiles.
Available on CPAN:
http://search.cpan.org/dist/Test-FormValidator/lib/Test/FormValidator.pm
The basic idea is that instead of writing your validation profiles and
then debugging them with a web browser, you can throw input scenarios at
your profiles by coping and pasting them in your text editor.
use Test::FormValidator 'no_plan';
my $tfv = Test::FormValidator->new;
$tfv->profile(WebApp->_change_password_profile);
# The profile should detect a bad email address
$tfv->check(
'email' => 'test-at-example.com',
);
$tfv->invalid_ok(['email'], "caught bad email address");
# and catch missing fields
$tfv->check(
'email' => 'someone-at-example.com',
'old_pass' => 'seekrit',
'new_pass1' => 'foo',
);
$tfv->missing_ok(['new_pass2'], "caught missing retyped password");
Michael
---
Michael Graham <suppressed>
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/suppressed/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed
Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.