X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoose-Policy.git;a=blobdiff_plain;f=t%2F001_basic.t;h=618b56ab0398179e9c5b96b8a799e38767bdd3c1;hp=549a5c661976b760c29885e19dc60ac87c4a1d21;hb=7efb32071f3f1526e3d64c30cf2afd224c9408b7;hpb=5d1afb587de9486c5740ff030d6a60b434634c4a diff --git a/t/001_basic.t b/t/001_basic.t index 549a5c6..618b56a 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -15,7 +15,7 @@ BEGIN { extends 'Moose::Meta::Attribute'; - before '_process_options' => sub { + sub _process_options { my ($class, $name, $options) = @_; if (exists $options->{is}) { if ($options->{is} eq 'ro') { @@ -27,10 +27,11 @@ BEGIN { } delete $options->{is}; } - }; + + $class->SUPER::_process_options($name, $options); + } } - { package My::Moose::Policy; use constant attribute_metaclass => 'My::Moose::Meta::Attribute'; @@ -45,6 +46,10 @@ BEGIN { has 'bar' => (default => 'Foo::bar'); } +isa_ok(Foo->meta, 'Moose::Meta::Class'); +is(Foo->meta->attribute_metaclass, 'My::Moose::Meta::Attribute', '... got our custom attr metaclass'); + +isa_ok(Foo->meta->get_attribute('bar'), 'My::Moose::Meta::Attribute'); my $foo = Foo->new; isa_ok($foo, 'Foo');