[Catalyst] Catalyst-Model-Validated example broken?

Guillaume Chambriat gc at riseup.net
Fri Jun 12 15:11:50 GMT 2009


wishing to use Moose type constraints to validate my actions input,
I eventually discovered examples/Catalyst-Model-Validated in the SVN

Does anyone use this code? If not, what are you using instead?

As it seems to be quite an elegant way to achieve my needs, despite
the apparent alpha status, I wanted to give it a try, but I ran into
a few problems.

1. there seems to be some inconsistency in it: both Makefile.PL and
   POD reference the nonexistent Catalyst::Model::ValidatedAction
   instead of Catalyst::Model::Validated

2. more importantly, after fixing this, running the test server with
   Catalyst::Runtime 5.80005 fails with the following error, which
   I was unfortunately not able to fix:

Couldn't instantiate component "MyApp::Model::User", COMPONENT()
method (from Catalyst::Model::Validated) didn't return an object-like
value (value was MyApp::Model::User). at script/myapp_server.pl line
Compilation failed in require at script/myapp_server.pl line 55.

3. using Class::MOP 0.85, the test suite fails.

Not only it outputs a bunch of deprecation warnings (which might be
the root of the other encountered problems... or not):

  The compute_all_applicable_attributes method has been deprecated.
  Use get_all_attributes instead.
  at /usr/local/lib/perl/5.10.0/Class/MOP/Class.pm line 974

But 01-basic.t's test #12 fails:

  Use of uninitialized value $value in length at
  line 190.

  #   Failed test at t/01-basic.t line 75.
  #     Structures begin differing at:
  #          $got->{baz}[0] = 'required'
  #     $expected->{baz}[0] = 'HashRef'
  # Looks like you failed 1 test of 12.
  t/01-basic.t .. Dubious, test returned 1 (wstat 256, 0x100)
  Failed 1/12 subtests

Any idea?

  Guillaume Chambriat <gc at riseup.net>

More information about the Catalyst mailing list