use strict;
use warnings;
-use Test::More tests => 8;
+use Test::More 'no_plan';
BEGIN {
use_ok('Moose::Policy');
extends 'Moose::Meta::Attribute';
+ # this method (mostly stolen from M::M::Attribute) just rebuilds the
+ # options so anything with 'is' gets PBP accessors
sub _process_options {
my ($class, $name, $options) = @_;
if (exists $options->{is}) {
{
package My::Moose::Policy;
+ # policy just specifies metaclass delegates
use constant attribute_metaclass => 'My::Moose::Meta::Attribute';
}
use Moose;
has 'bar' => (is => 'rw', default => 'Foo::bar');
+ has 'baz' => (is => 'ro', default => 'Foo::baz');
}
isa_ok(Foo->meta, 'Moose::Meta::Class');
can_ok($foo, 'get_bar');
can_ok($foo, 'set_bar');
+can_ok($foo, 'get_baz');
+
is($foo->get_bar, 'Foo::bar', '... got the right default value');
+is($foo->get_baz, 'Foo::baz', '... got the right default value');