X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fbasic.t;h=8f6c1cacf1bb85cea5952816d05d1e1dd49ad95a;hb=097c939028f5fc12eec2597c87b17798474f7dc3;hp=9e0e5d5f5f3fd4b045707fbe308ccab4834e1746;hpb=a623c11370371e7e44577fa0938c57371d0d4103;p=gitmo%2FMooseX-FollowPBP.git diff --git a/t/basic.t b/t/basic.t index 9e0e5d5..8f6c1ca 100644 --- a/t/basic.t +++ b/t/basic.t @@ -34,6 +34,15 @@ use Test::More; has 'thing2' => ( is => 'rw', writer => 'set_it' ); } +{ + package PBP4; + + use Moose; + use MooseX::FollowPBP; + + has 'bare' => ( is => 'bare' ); +} + ok( ! Standard->can('get_thing'), 'Standard->get_thing() does not exist' ); ok( ! Standard->can('set_thing'), 'Standard->set_thing() does not exist' ); @@ -52,4 +61,24 @@ ok( ! PBP3->can('set_thing'), 'PBP3->set_thing does not exist' ); ok( ! PBP3->can('get_thing2'), 'PBP3->get_thing2 does not exist' ); ok( ! PBP3->can('set_thing2'), 'PBP3->set_thing2 does not exist' ); +ok( !PBP4->can('get_bare'), 'is => bare attribute is respected' ); +ok( !PBP4->can('set_bare'), 'is => bare attribute is respected' ); + +{ + package PBP::Role; + use Moose::Role; + use MooseX::FollowPBP; + has foo => (is => 'rw'); +} + +{ + package PBP::WithRole; + use Moose; + with 'PBP::Role'; +} + +ok( PBP::WithRole->can('get_foo'), "works in a role" ); +ok( PBP::WithRole->can('set_foo'), "works in a role" ); +ok( !PBP::WithRole->can('foo'), "works in a role" ); + done_testing();