Closed andyjack closed 9 years ago
Some more information, moving sub xyz
after the has
doesn't cause the error anymore, vars_ok
works, but test_vars
has a different error:
package Baz;
use Moose::Role;
has xyzzy => (
is => 'ro',
isa => 'Str',
default => 'Baz',
);
sub xyzzy;
no Moose::Role;
1;
$ perl -MTest::Vars -le 'use strict; use warnings; test_vars("lib/Baz.pm")'
Can't use an undefined value as a subroutine reference at /opt/perl5.20.2/lib/site_perl/5.20.2/Test/Vars.pm line 89, <GEN0> line 4.
$ perl -MTest::Vars -le 'use strict; use warnings; vars_ok("lib/Baz.pm")'
ok 1 - lib/Baz.pm
# checking Baz in Baz.pm ...
# Tests were run but no plan was declared and done_testing() was not seen.
test_vars requires a coderef as its second argument.
Fixed in 0.008.
In a Moose role with a stub
sub
declaration,test_vars
dies with the above error