Moose Test Postette

Test postette day here in the Moose-Pen

Been a few days since I did a bottom up test on Database::Accessor and seeing it is a rainy Saturday I figure I could do a quick on.

Starting with Database::Accessor I do not suspect much to go amiss as I only had ' 2 files changed, 41 insertions(+), 6 deletions(-)' but one never knows;


Can't locate MooseX/Enumeration.pm in
opps; Better install that and try again.

After that was installed I got somewhat better results;


All tests successful.
Files=29, Tests=524,

Onto Driver::DBI and lets see what is new '10 files changed, 433 insertions(+), 45 deletions(-)'. Lots of changes but most are in the new practical 'xt' dir so I am not expecting much of a fail rate;


t/40_joins.t ............ Dubious, test returned 17 (wstat 4352, 0x1100)
Failed 17/40 subtests
Ok I expected that as I most of the fails were;

Expected UPDATE people SET first_name = ?, last_name = ? LEFT JOIN address ON people.id !=
 LEFT(address.city_id,?) WHERE people.first_name = ?

Generated UPDATE people SET first_name = ?, last_name = ? WHERE people.first_name = ?


Which was a result of the decision on my part to exclude joins from Updates and Deletes so I have a little fixing to do in the expected SQL.

After I cleaned up all those joins I then got this error;


Expected LEFT JOIN address test ON people.id = test.user_id WHERE people.first_name = ?
Generated LEFT JOIN address test ON people.id = address.user_id WHERE people.first_name = ?

So still getting a problem with alias and join. I think will have to go back ans look at how I handle links/joins and alias will most likely have to scrap any automated handing of aliases and links/joins.

For now I will just fix up that test;


links => {
type => 'LEFT',
to => { name => 'address',
alias=> 'test' },
conditions => [
{
left => { name => 'id' },
right => {
name => 'user_id',
++ alias=> 'test',
}
}
]
},

and even after that fix I still get the same fail. Oh well something for tomorrow's post.

maxresdefault.jpg

Leave a comment

About byterock

user-pic Long time Perl guy, a few CPAN mods allot of work on DBD::Oracle and a few YAPC presentations