Subject: | Bug in Test::Class |
Date: | Thu, 23 Oct 2014 11:12:43 -0500 |
To: | bug-Test-Class [...] rt.cpan.org |
From: | Felipe Gasper <felipe [...] felipegasper.com> |
===========================
#!/usr/bin/perl
package My::TestUtils;
use parent qw(Test::Class);
use Test::More;
sub _skip {
my ($self) = @_;
skip "oops!", $self->num_tests();
}
package My::Tests;
BEGIN {
push @ISA, 'My::TestUtils';
}
use Test::More;
if (!caller) {
plan tests => __PACKAGE__->expected_tests();
__PACKAGE__->new()->runtests();
}
sub the_test : Test() {
my ($self) = @_;
SKIP: {
$self->_skip();
ok 1;
}
}
=====================
The above code fails because Test::Class errantly tries to look for
the_test() as a test method of My::TestUtils.
Thank you!
-Felipe Gasper
Houston, TX