use strict;
use warnings;
-use Test::More tests => 84;
+use Test::More;
use Test::Exception;
-
{
package Thing;
use Moose;
has 'gorch' => (is => 'ro');
has 'gloum' => (is => 'ro', default => sub {[]});
+ has 'fleem' => (is => 'ro');
has 'bling' => (is => 'ro', isa => 'Thing');
has 'blang' => (is => 'ro', isa => 'Thing', handles => ['goodbye']);
has 'one_last_one' => (is => 'rw', isa => 'Ref');
# this one will work here ....
- has 'fail' => (isa => 'CodeRef');
- has 'other_fail';
+ has 'fail' => (isa => 'CodeRef', is => 'bare');
+ has 'other_fail' => (is => 'bare');
package Bar;
use Moose;
} '... now can extend an attribute with a non-subtype';
::lives_ok {
+ has '+fleem' => (weak_ref => 1);
+ } '... now allowed to add the weak_ref option via inheritance';
+
+ ::lives_ok {
has '+bling' => (handles => ['hello']);
} '... we can add the handles attribute option';
::dies_ok {
has '+other_fail' => (trigger => sub {});
} '... cannot create an attribute with an illegal option';
- ::dies_ok {
- has '+other_fail' => (weak_ref => 1);
- } '... cannot create an attribute with an illegal option';
::throws_ok {
has '+does_not_exist' => (isa => 'Str');
} qr/in Bar/, '... cannot extend a non-existing attribute';
ok(Bar->meta->get_attribute('bling')->has_handles,
'... Bar::foo should handles');
-
+done_testing;