6 use Test::More tests => 1;
9 use_ok('Moose::Policy');
13 package My::Moose::Meta::Attribute;
16 extends 'Moose::Meta::Attribute';
18 before '_process_options' => sub {
19 my ($class, $name, $options) = @_;
20 if (exists $options->{is}) {
21 if ($options->{is} eq 'ro') {
22 $options->{reader} = 'get_' . $name;
24 elsif ($options->{is} eq 'rw') {
25 $options->{reader} = 'get_' . $name;
26 $options->{writer} = 'set_' . $name;
28 delete $options->{is};
35 package My::Moose::Policy;
36 use constant attribute_metaclass => 'My::Moose::Meta::Attribute';
42 use Moose::Policy 'My::Moose::Policy';
45 has 'bar' => (default => 'Foo::bar');
52 can_ok($foo, 'get_bar');
53 can_ok($foo, 'set_bar');
55 is($foo->get_bar, 'Foo::bar', '... got the right default value');