You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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(@_);
};
The text was updated successfully, but these errors were encountered:
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.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:The text was updated successfully, but these errors were encountered: