X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_basic.t;fp=t%2F001_basic.t;h=fced7191d1da9c0248b781afccafeb0cadf7eee9;hb=bfacd619d119a4262f60eadcb431fae0cde270a1;hp=867445b924cd97b3958a2f38e2d10b42b5995cf7;hpb=e33af5b6745a1284e5187bf78c1ea55c6bc35644;p=gitmo%2FMoose-Policy.git diff --git a/t/001_basic.t b/t/001_basic.t index 867445b..fced719 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 8; +use Test::More 'no_plan'; BEGIN { use_ok('Moose::Policy'); @@ -15,6 +15,8 @@ BEGIN { 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}) { @@ -34,6 +36,7 @@ BEGIN { { package My::Moose::Policy; + # policy just specifies metaclass delegates use constant attribute_metaclass => 'My::Moose::Meta::Attribute'; } @@ -44,6 +47,7 @@ BEGIN { use Moose; has 'bar' => (is => 'rw', default => 'Foo::bar'); + has 'baz' => (is => 'ro', default => 'Foo::baz'); } isa_ok(Foo->meta, 'Moose::Meta::Class'); @@ -57,7 +61,10 @@ isa_ok($foo, 'Foo'); 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');