From: ewilhelm Date: Sat, 5 Aug 2006 22:30:14 +0000 (+0000) Subject: t/001_basic.t - whitespace weirdness bugs me X-Git-Tag: 0_01~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3cebad5ebbe89eca34b8feeaafd8678417c8b74;p=gitmo%2FMoose-Policy.git t/001_basic.t - whitespace weirdness bugs me --- diff --git a/t/001_basic.t b/t/001_basic.t index fced719..d5f7fc5 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -6,30 +6,30 @@ use warnings; use Test::More 'no_plan'; BEGIN { - use_ok('Moose::Policy'); + use_ok('Moose::Policy'); } { package My::Moose::Meta::Attribute; use Moose; - + 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}) { - if ($options->{is} eq 'ro') { - $options->{reader} = 'get_' . $name; - } - elsif ($options->{is} eq 'rw') { - $options->{reader} = 'get_' . $name; - $options->{writer} = 'set_' . $name; - } - delete $options->{is}; - } - + if (exists $options->{is}) { + if ($options->{is} eq 'ro') { + $options->{reader} = 'get_' . $name; + } + elsif ($options->{is} eq 'rw') { + $options->{reader} = 'get_' . $name; + $options->{writer} = 'set_' . $name; + } + delete $options->{is}; + } + $class->SUPER::_process_options($name, $options); } } @@ -42,10 +42,10 @@ BEGIN { { package Foo; - + use Moose::Policy 'My::Moose::Policy'; use Moose; - + has 'bar' => (is => 'rw', default => 'Foo::bar'); has 'baz' => (is => 'ro', default => 'Foo::baz'); } @@ -66,7 +66,4 @@ 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'); - - - - +# vim:ts=4:sw=4:et:sta