Require Perl 5.6.1+
[gitmo/MooseX-SemiAffordanceAccessor.git] / t / basic.t
1 use strict;
2 use warnings;
3
4 use Test::More tests => 8;
5
6
7 {
8     package Standard;
9
10     use Moose;
11
12     has 'thing' => ( is => 'rw' );
13     has '_private' => ( is => 'rw' );
14 }
15
16 {
17     package SF;
18
19     use Moose::Policy 'MooseX::Policy::SemiAffordanceAccessor';
20     use Moose;
21
22     has 'thing' => ( is => 'rw' );
23     has '_private' => ( is => 'rw' );
24 }
25
26
27 ok( Standard->can('thing'), 'Standard->thing() exists' );
28 ok( ! Standard->can('set_thing'), 'Standard->set_thing() does not exist' );
29 ok( Standard->can('_private'), 'Standard->_private() exists' );
30 ok( ! Standard->can('_set_private'), 'Standard->_set_private() does not exist' );
31
32 ok( SF->can('thing'), 'SF->thing() exists' );
33 ok( SF->can('set_thing'), 'SF->set_thing() exists' );
34 ok( SF->can('_private'), 'SF->_private() exists' );
35 ok( SF->can('_set_private'), 'SF->_set_private() exists' );