How can I use Moose with Test::Class?
Posted
by
rassie
on Stack Overflow
See other posts from Stack Overflow
or by rassie
Published on 2010-05-14T17:45:51Z
Indexed on
2012/09/05
9:38 UTC
Read the original article
Hit count: 409
I'm currently refactoring a test suite built up by a colleague and would like to use Test::Class[::Most]
while doing so. As I started I figured out I could really use a couple of Moose
roles to decouple code a little bit. However, it seems it's not quite possible -- I'm getting error messages like this one:
Prototype mismatch: sub My::Test::Class::Base::blessed: none vs ($) at
/usr/lib/perl5/vendor_perl/5.8.8/Sub/Exporter.pm line 896
So the question is: can I use Moose
together with Test::Class
and if so, how?
PS: The code goes like this:
package My::Test::Class::Base;
use Moose;
use Test::Class::Most;
with 'My::Cool::Role';
has attr => ( ... );
© Stack Overflow or respective owner