Skip Menu |

This queue is for tickets about the Test-Class CPAN distribution.

Report information
The Basics
Id: 55481
Status: rejected
Priority: 0/
Queue: Test-Class

People
Owner: Nobody in particular
Requestors: IRONCAMEL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.34
Fixed in: (no value)



Subject: using Test::MockObject causes warning
I am using Test::MockObject in my tests. This in turn uses chromatics 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' ) 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; #---
Subject: Re: [rt.cpan.org #55481] using Test::MockObject causes warning
Date: Sun, 14 Mar 2010 02:30:58 +1100
To: bug-Test-Class [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
This is quite possibly the mythical non-reentrance bug in UNIVERSAL::isa. 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: Show quoted text
> 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 > 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' ) > > 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; > #--- >
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; > > #--- > >
Subject: Re: [rt.cpan.org #55481] using Test::MockObject causes warning
Date: Mon, 15 Mar 2010 13:10:35 +1100
To: bug-Test-Class [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Static method calls in the style SubClass->isa('Class') is a completely legitimate use of isa. Adam K On 14 March 2010 16:58, Naveed Massjouni via RT <bug-Test-Class@rt.cpan.org> wrote: Show quoted text
>       Queue: Test-Class >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55481 > > > 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:
>> This is quite possibly the mythical non-reentrance bug in
> UNIVERSAL::isa.
>> >> 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
>> > 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'
> )
>> > >> > 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; >> > #--- >> >
> > > >
As Adam said we're doing the right thing. I'd suggest reporting it to the author of UNIVERSAL::isa.
On Thu Aug 19 10:04:46 2010, ADIE wrote: Show quoted text
> As Adam said we're doing the right thing. I'd suggest reporting it to > the author of > UNIVERSAL::isa.
I actually talked to chromatic yesterday on IRC and he explained that he had plans to provide a -debug flag for Test::MockObject which would disable UNIVERSAL::isa and UNIVERSAL::can. He also said he would put Test::MockObject on github. If he does that, I could even patch it myself for him. https://rt.cpan.org/Ticket/Display.html?id=60497 If someone knows a better way to link RT tickets together, let me know :)
Marking this one as rejected - since it's a Test::MockObject / UNIVERSAL::isa issue rather than a Test::Class one. Cheers, ADrian
Subject: Re: [rt.cpan.org #55481] using Test::MockObject causes warning
Date: Sun, 17 Apr 2011 23:38:00 +1000
To: bug-Test-Class [...] rt.cpan.org
From: Adam Kennedy <adamkennedybackup [...] gmail.com>
Shouldn't refect it, you forward it on to the other queue instead. On 16 April 2011 23:49, Adrian Howard via RT <bug-Test-Class@rt.cpan.org> wrote: Show quoted text
>       Queue: Test-Class >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=55481 > > > Marking this one as rejected - since it's a Test::MockObject / UNIVERSAL::isa issue rather than a > Test::Class one. > > Cheers, > > ADrian >
How do you forward to another module's queue in RT? Can't see how?
Forget it. Bug already in the queue: https://rt.cpan.org/Ticket/Display.html?id=22367 Adrian On Sun Apr 17 09:42:24 2011, ADIE wrote: Show quoted text
> How do you forward to another module's queue in RT? Can't see how?