From: stevan Date: Sat, 5 Aug 2006 21:18:37 +0000 (+0000) Subject: basic-test X-Git-Tag: 0_01~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b14c8df5cc7592d2ee2b1b50080c416cfcb703e5;p=gitmo%2FMoose-Policy.git basic-test --- diff --git a/t/000_load.t b/t/000_load.t index 298e89c..27eb2cb 100644 --- a/t/000_load.t +++ b/t/000_load.t @@ -6,5 +6,5 @@ use warnings; use Test::More tests => 1; BEGIN { - use_ok('Moose'); + use_ok('Moose::Policy'); } \ No newline at end of file diff --git a/t/001_basic.t b/t/001_basic.t index 298e89c..cdc3c2b 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -6,5 +6,33 @@ use warnings; use Test::More tests => 1; BEGIN { - use_ok('Moose'); + use_ok('Moose::Policy'); +} + +{ + package My::Moose::Meta::Attribute; + use Moose; + + extends 'Moose::Meta::Attribute'; + + before '_process_options' => sub { + 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}; + } + }; +} + + +{ + package My::Moose::Policy; + + } \ No newline at end of file