[Dbix-class] install problem

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Mon Jan 16 13:04:29 CET 2006


On Mon, 2006-01-16 at 10:56 +0000, Dave Howorth wrote:
> Sorry, I'm not sure how to do that. I tried it against your new
> developer release with the same result:
> 
> t/cdbi-t/01-columns................Can't infer join condition for state
> on City; unable to load State
> at /root/.cpan/build/DBIx-Class-0.04999_02/blib/lib/DBIx/Class/CDBICompat/HasA.pm line 23
> # Looks like your test died before it could output anything.
> t/cdbi-t/01-columns................dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1-24
>         Failed 24/24 tests, 0.00% okay

> I tried to run the test standalone:
> 
> cpepc210-3:~/.cpan/build/DBIx-Class-0.04999_02 # perl
> t/cdbi-t/01-columns.t
> Is there a magic incantation to run the tests?

Doh, Monday morning stupid! It's not installed yet.

Anyway, I finally ran it and tracked down the problem.
t/cdbi-t/01-columns.t says (among other things):

...
package State;
...
package City;
...
City->has_a(State => 'State');

That method call is resolved to DBIx/Class/CDBICompat/HasA.pm which
says, in a context where $f_class eq 'State':

 eval "require $f_class";

That causes a search though @INC and on my machine there *is* a package
called State, so the eval resolves to that package, which has nothing to
do with DBIx::Class or cities etc. Not surprisingly, the test fails when
it tries to invoke methods on that class.

A workaround for installation is obvious to me, but it's only 4 minutes
out of Monday morning, so I won't attempt to suggest a permanent
solution!

Cheers, Dave




More information about the Dbix-class mailing list