[Dbix-class] helperrels vs basicrels

Aran Deltac aran at arandeltac.com
Sun May 14 10:54:31 CEST 2006

I've been working on writing a Manual POD about how testing works in
DBIC.  The introduction of the document describes the reasoning:

"Too many times I have heard on the mailing list and the #dbix-class
IRC channel that people don't understand how the DBIx::Class testing
framework works.  To be honest I was a bit perturbed myself the first
time I tried to wade in to it.  The goal of this document is to give
an overview of how the framework is setup, how you can add your own
tests, and how you can apply a similar framework to your own
distributions that use DBIx::Class."

So, to that end, I have been going over the structure of how tests are
written and how the whole structure works.  I've run in to one thing
that I would like to have work differently.

The difference between BasicRels and HelperRels seems unnecessary.  I
could understand that back in the day, before there were helper
methods for creating relationships, that you would have the BasicRels
code which would call add_relationship as it currently does.  Then,
the day came along when the higher level methods like belong_to and
has_many were added and rather than remove the add_relationship code
it was moved in to BasicRels and then HelperRels was created.  I think
we are suitably past that day and that HelperRels tests the same thing
as BasicRels, plus more, since behind the scenes HelperRels does the
exact same thing BasicRels does.  BasicRels adds an added, yet
unnecessary, level of complexity and maintanence headaches.

So, I want to ditch BasicRels and most of t/basicrels/*.  Then, move
all the tests in t/helperrels/* to t/*.  Or, perhaps thats a bit messy
and it would be better to just rename the helperrels/ folder to core/
or some such.

I'm hoping that this is just some housekeeping that people have been
intending to do and just haven't gotten to yet.  If so, do my thoughts
fit with the plan?  What else is intended?

In that vein - does anyone have anything on their wish list of things
that they would like to change about how we test DBIC?


More information about the Dbix-class mailing list