Moose Loose Ends Part the XIII

Its discovery day here in the Moose-Pen

I was all ready to wrap up my 'new' constructor errors when I figured I better see what I get when I do something like this;


$da->reset_conditions();
$da->add_condition( {
right => { value => 'test' },
operator => '=',
},);


which will fail as I have no 'left' on that 'condition' and that is what I got.

Attribute (left) is required at D:\GitHub\database-acces…

Moose Loose Ends Part the XII

Well its fix one break everything day here in the Moose-Pen

I thouhg it was just going to be one of those quick look how well things pass postette days today but I was dead wrong;

I did a check in a a quick push and then ran the full test suite and got


t/20_dad_load.t ............. Attribute (conditions) does not pass the type constraint because: ArrayRefofConditions can not be an empty array ref at /usr/local/lib/perl/5.18.2/Moose/Object.pm line 24
Moose::Object::new('Database::Accessor', 'HASH(0x2eeb320)') called at t…

Moose Loose Ends Part the XI

Never say never day here in the Moose-pen

Just when I though I had all the bugs out of my Database::Accessor I found a bunch more while finishing off tests case '42_new_validation.t'.

Most of the bugs where with the 'links' attribute. My test for this attribute are a check to make sure a link has a 'to' is present, and it not undef, and the same for type and then at lease on condition is present.

The first bug was


not ok 19 - type is proper link ; links


and the error it was throwing was;
/var/www/users/byterock/index.html

Moose Loose Ends Part the X

Its make and mend day here in the Moose-Pen

Now that I have my constructor single error working the way I like I figure I better go back and clean up my test cases and create a new test case just to check the error on 'new' construction.

I am going to start with '30_view.t' as that is the one I have been mucking with most over the past little while.

The first thing I did was strip out the new 'validation' tests and suck them in a new tests case '42_new_validation.t' and after a few adjustments it presently looks like this;


m…

Moose Loose Ends Part the IX

Another postette day here in the Moose-Pen

I had only one little goal today and that is come up with a really nice single construction error message. After a good hour or so of mucking about I finally came up with;


The following Attribute is required: (view->name)
The following Attribute did not pass validation:
'view->alias' Constraint: Validation failed for 'Str' with value [ ]
With constructor hash:
{
'elements' => [{ name => 'first_name', }, { name => 'last_name', }],
'view' => {