if ($args->{lazy}) {
(exists $args->{default} || defined $args->{builder})
- || $class->throw_error("You cannot have lazy attribute ($name) without specifying a default value for it");
+ || $class->throw_error("You cannot have a lazy attribute ($name) without specifying a default value for it");
}
return;
use strict;
use warnings;
use Test::More;
-use Test::Exception;
my $lazy_run = 0;
default => "welp",
);
- ::throws_ok {
+ eval {
has lazy_no_default => (
is => 'rw',
lazy => 1,
);
- } qr/You cannot have lazy attribute \(lazy_no_default\) without specifying a default value for it/;
+ };
+ ::like $@, qr/You cannot have a lazy attribute \(lazy_no_default\) without specifying a default value for it/;
};
my $object = Class->new;
if(svp && sv_true(*svp)){
if(!(has_default || has_builder)){
mouse_throw_error(klass, NULL,
- "You cannot have lazy attribute (%"SVf") without specifying "
+ "You cannot have a lazy attribute (%"SVf") without specifying "
"a default value for it", name);
}
}