Test::CDBI::Basic - Very basic testing of Class::DBI classes
Allows for quick and dirty testing of Class::DBI classes
use strict; use warnings; use Test::More tests => 31; use Test::CDBI::Basic qw( test_class ); use Some::DBI::Class; test_class( 'Sequins::DBI::Hit' );
This module does something very simple that I find myself doing whenever I write tests for Class::DBI subclasses. It reads in the class, tries to create a new object, and then goes through the columns, attempting to assign the value of 1 to every column. It doesn't check if the column was actually updated. Basically then, it allows you to check your column definitions match reality. It won't attempt to assign a value to any column set as a primary column. It does this in the most naive way possible, and then tries to delete the object created.
It makes a call to ok, however that's defined in the calling class, when an object was created, and once for every column.
ok
Accepts a class name and an optional list of arguments to be treated like a hash to pass to your class's create method.
create
Peter Sergeant - pete [a] clueball.com
pete [a] clueball.com
As perl itself
To install Test::CDBI::Basic, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::CDBI::Basic
CPAN shell
perl -MCPAN -e shell install Test::CDBI::Basic
For more information on module installation, please visit the detailed CPAN module installation guide.