6 use Test::More tests => 12;
11 use_ok('Moose::Meta::Role');
16 our $VERSION = '0.01';
17 sub foo { 'FooRole::foo' }
24 has 'foos' => (is => 'ro', lazy_build => 1);
25 sub _build_foos{ "many foos" }
30 my $foo_role = Moose::Meta::Role->initialize('FooRole');
33 lives_ok{ Foo->new } "lazy_build works";
34 is(Foo->new->foos, 'many foos' , "correct value for 'foos'");
35 lives_ok{ $meta->make_immutable } "Foo is imutable";
36 dies_ok{ $meta->add_role($foo_role) } "Add Role is locked";
37 lives_ok{ Foo->new } "Inlined constructor works with lazy_build";
38 is(Foo->new->foos, 'many foos' , "correct value for 'foos'");
39 lives_ok{ $meta->make_mutable } "Foo is mutable";
40 lives_ok{ $meta->add_role($foo_role) } "Add Role is unlocked";
64 lives_ok { Bar->meta->make_immutable }
65 'Immutable meta with single BUILD';
67 lives_ok { Baz->meta->make_immutable }
68 'Immutable meta with multiple BUILDs';
72 Nothing here yet, but soon :)