I did a little more investigating.
So line 307 is:
$object_or_class->isa( $class ) and $object_or_class->can( 'runtests' )
The value of $object_or_class at that point is the string
'Test::Data::Dumper', for the code snippet I provided. So chromatic's
UNIVERSAL::isa correctly warns that isa is being called as a function,
not a method. By correct, I mean it is doing what the author intended
(I think). So I agree that your code is not doing anything wrong. The
big problem I think is that Test::MockObject uses UNIVERSAL::isa, and
there is no sane way to turn off those warnings. I put [no warnings
'UNIVERSAL::isa'] all over my code with no success.
On Sat Mar 13 10:32:08 2010, adam@ali.as wrote:
Show quoted text> This is quite possibly the mythical non-reentrance bug in
UNIVERSAL::isa.
Show quoted text>
> If you can put together a demonstration in the form of a small test
> script, file it against that module and have him fit it.
>
> Because we're doing completely the right thing here.
>
> Adam K
>
> On 12 March 2010 07:24, Naveed Massjouni via RT
> <bug-Test-Class@rt.cpan.org> wrote:
> > Thu Mar 11 15:24:40 2010: Request 55481 was acted upon.
> > Transaction: Ticket created by IRONCAMEL
> > Queue: Test-Class
> > Subject: using Test::MockObject causes warning
> > Broken in: 0.34
> > Severity: Important
> > Owner: Nobody
> > Requestors: IRONCAMEL@cpan.org
> > Status: new
> > Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=55481 >
> >
> >
> > I am using Test::MockObject in my tests. This in turn uses
chromatics
Show quoted text> > UNIVERSAL::isa, which causes the following warning:
> >
> > Called UNIVERSAL::isa() as a function, not a method at
> > /usr/lib/perl5/site_perl/5.8.8/Test/Class.pm line 307
> >
> > Line 307 is the following:
> > $object_or_class->isa( $class ) and $object_or_class->can( 'runtests'
)
Show quoted text> >
> > Here is some sample code that will cause this:
> >
> > #---
> > use Test::Class::Sugar;
> >
> > testclass exercises Data::Dumper {
> > use Test::MockObject;
> > test something {
> > ok 1, 'good job';
> > }
> > }
> >
> > Test::Class->runtests;
> > #---
> >