From: Dave Rolsky Date: Wed, 21 Jul 2010 00:19:37 +0000 (-0500) Subject: respect is => bare X-Git-Tag: v0.04~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-FollowPBP.git;a=commitdiff_plain;h=7e7ad65a4d2e56312e1f147cbce1e6b47a1e9514 respect is => bare --- diff --git a/lib/MooseX/FollowPBP/Role/Attribute.pm b/lib/MooseX/FollowPBP/Role/Attribute.pm index db3e385..2b31a66 100644 --- a/lib/MooseX/FollowPBP/Role/Attribute.pm +++ b/lib/MooseX/FollowPBP/Role/Attribute.pm @@ -10,8 +10,9 @@ before _process_options => sub { my $name = shift; my $options = shift; - if ( exists $options->{is} - && !( exists $options->{reader} || exists $options->{writer} ) ) { + if ( exists $options->{is} + && !( exists $options->{reader} || exists $options->{writer} ) + && $options->{is} ne 'bare' ) { my $get; my $set; diff --git a/t/basic.t b/t/basic.t index 9e0e5d5..c14d332 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,7 @@ 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' ); + done_testing();