Moose Troubles

Another quick fix postette today in the Moose-Pen

Yesterday I had my gather test fail with;


ok 46 - Second Gather element does not inherit view
not ok 47 - Third Gather element inherits view

and a

Can't call method "predicates" on an undefined value at 57_dad_elements.t line 486.
# Looks like your test exited with 255 just after 49.


A quick check of the test and the input and found a 'condtions' where I should have had a 'conditions' so that fixed that and all the links and sorts passed but I did get this for the gather

...
not ok 47 - Third Gather element inherits view
ok 48 - Gather condition index 0 left inherit view
ok 49 - Gather condition index 1 left does not inherit view
not ok 50 - Gather condition index 2 left->left inherits view
not ok 51 - Gather condition index 2 left->right->left->left does not inherit view
not ok 52 - Gather condition index 2 left->right->left->right does not inherit view
not ok 53 - Gather condition index 2 right inherits view

So there still must be a problem in the Accessor.pm code.

As all of fails where coming off the 'dynamic_gather' attribute I quickly tracked it down to these lines


if ( $self->gather() ) {
push(
@items,
(
@{ $self->gather->conditions }, @{ $self->gather->elements }
)
);
}

Where I forgot to add in the 'dynamic_gather' to check, it only took this quick change;

if ( $self->gather() || $self->dynamic_gather() ) {
push(
@items,
(
@{ $self->gather->conditions }, @{ $self->gather->elements }, @{ $self->dynamic_gather->conditions }, @{ $self->dynamic_gather->elements }
)
);
}

and I got

...
ok 45 - First Gather element inherits view
ok 46 - Second Gather element does not inherit view
ok 47 - Third Gather element inherits view
ok 48 - Gather condition index 0 left inherit view
ok 49 - Gather condition index 1 left does not inherit view
ok 50 - Gather condition index 2 left->left inherits view
ok 51 - Gather condition index 2 left->right->left->left does not inherit view
ok 52 - Gather condition index 2 left->right->left->right does not inherit view
ok 53 - Gather condition index 2 right inherits view

now my moose is off a running;

DSC01155a.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