When I write a base class, it's often something like:
package TestsFor::SomeCompany;
use Test::Class::Moose;
with qw(Test::Class::Moose::Role::Autouse);
1;
That's always worked (so far) because there's almost always a corresponding SomeCompany.pm file. Today that turned out to not be the case. However, we should try to decouple that and have the autouse role recognize when we don't need a corresponding class. This was a coupling mistake I made and am thinking about a clean solution for the fix. Until then, the following workaround in your TCM base class should suffice:
around 'get_class_name_to_use' => sub {
my $orig = shift;
my $self = shift;
if ( __PACKAGE__ eq ref $self ) {
return '';
}
return $self->$orig(@_);
};
When I write a base class, it's often something like:
That's always worked (so far) because there's almost always a corresponding
SomeCompany.pmfile. Today that turned out to not be the case. However, we should try to decouple that and have the autouse role recognize when we don't need a corresponding class. This was a coupling mistake I made and am thinking about a clean solution for the fix. Until then, the following workaround in your TCM base class should suffice: