Right now when i do something like this:
use strict;
use warnings;
package My::Test;
use parent 'Test::Class';
use Test::More;
sub overrides_basic : Tests {
ok( 1, "works" ); ok( 1, "works" );
}
sub overrides_no_profile : Tests {
ok( 2, "works" ); ok( 2, "works" );
}
__PACKAGE__->runtests;
1;
The output is this:
ok 1 - works
ok 2 - works
ok 3 - works
ok 4 - works
1..4
This is not very nice.
However, if i do this:
use strict;
use warnings;
package My::Test;
use parent 'Test::Class';
use Test::More;
sub overrides_basic : Tests {
subtest 'overrides_basic' => sub {
ok( 1, "works" ); ok( 1, "works" );
};
}
sub overrides_no_profile : Tests {
subtest 'overrides_no_profile' => sub {
ok( 2, "works" ); ok( 2, "works" );
};
}
__PACKAGE__->runtests;
1;
The output is nicer and more desirable, like this:
ok 1 - works
ok 2 - works
1..2
ok 1 - overrides_basic
ok 1 - works
ok 2 - works
1..2
ok 2 - overrides_no_profile
1..2
The problem here is that this is a lot of unnecessary typing work to do. So for now, i'll just be sub-classing Test::Class to redefine the Tests sub-arg.
However I am wondering if there already is a simple solution for this that i was unable to find.