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

Report information
The Basics
Id:
78564
Status:
resolved
Priority:
Low/Low
Queue:

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

BugTracker
Severity:
(no value)
Broken in:
0.25
Fixed in:
(no value)



Subject: Can not use Test::Most in test modules with Moose
For some tests I need at first the same code to run to a special point. So I packed that test code into a Module and used Moose because I need different attributes. So I write package TestFoo; use Moose; use Test::Most; ... And I get Prototype mismatch: sub TestFoo::blessed ($) vs none at /usr/lib64/perl5/vendor_perl/5.12.4/Test/Builder/Module.pm line 93 Test::Builder::Module::import(undef) called at .../t/.../lib/TestFoo.pm line 3 TestFoo::BEGIN() called at .../t/.../lib/TestFoo.pm line 3 eval {...} called at .../t/.../lib/TestFoo.pm line 3 require TestFoo.pm called at .../t/.../01_foo.t line 3 main::BEGIN() called at .../t/.../lib/TestFoo.pm line 3 eval {...} called at .../t/.../lib/TestFoo.pm line 3 Here is the code of the test script: use strict; use warnings; use Test::Most tests => 1; use Test::NoWarnings; use TestFoo; ok 1; The workaround is to remove Test::Most from Module and use Test::More instead.
Sorry for not getting to this sooner. I've uploaded 0.30 and it fixes the issue by excluding Test::Deep::blessed() by default. It should be on your local CPAN mirror soon. Cheers, Ovid
tried 0.30 I append the files. -------------------------------------------------------
Show quoted text
>prove -v foo.t
foo.t .. 1..3 You tried to plan twice at (eval 198) line 1. at TestFoo.pm line 4 BEGIN failed--compilation aborted at TestFoo.pm line 4. Compilation failed in require at foo.t line 6. BEGIN failed--compilation aborted at foo.t line 6. Dubious, test returned 2 (wstat 512, 0x200) Failed 3/3 subtests Test Summary Report ------------------- foo.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 3 tests but ran 0. Files=1, Tests=0, 0 wallclock secs ( 0.06 usr + 0.03 sys = 0.09 CPU) Result: FAIL
Show quoted text
>
Subject: TestFoo.pm
package TestFoo; use Moose; use Test::Most; # I imort here only and do no plan! ok 1; 1;
Subject: foo.t
use strict; use warnings; use Test::Most tests => 3; use Test::NoWarnings; use TestFoo; ok 1;
OK, I can verify that this is a bug. Damn. I'll add a test and try to figure out what went wrong. Cheers, Ovid
This is fixed and pushed to https://github.com/Ovid/test--most I've also uploaded the new version to the CPAN. Thanks for the bug report. I had an error in how I was handling @EXPORT. Cheers, Ovid


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.