Commit | Line | Data |
a338e27f |
1 | use strict; |
2 | use warnings; |
3 | |
b95d9f9b |
4 | use Test::More tests => 12; |
a338e27f |
5 | |
6 | |
7 | { |
8 | package Standard; |
9 | |
10 | use Moose; |
11 | |
12 | has 'thing' => ( is => 'rw' ); |
13 | has '_private' => ( is => 'rw' ); |
14 | } |
15 | |
16 | { |
b95d9f9b |
17 | package SAA; |
a338e27f |
18 | |
b95d9f9b |
19 | use MooseX::SemiAffordanceAccessor; |
a338e27f |
20 | use Moose; |
21 | |
22 | has 'thing' => ( is => 'rw' ); |
23 | has '_private' => ( is => 'rw' ); |
24 | } |
25 | |
b95d9f9b |
26 | { |
27 | package SAA2; |
28 | |
29 | # Make sure load order doesn't matter |
30 | use Moose; |
31 | use MooseX::SemiAffordanceAccessor; |
32 | |
33 | has 'thing' => ( is => 'rw' ); |
34 | has '_private' => ( is => 'rw' ); |
35 | } |
36 | |
a338e27f |
37 | |
38 | ok( Standard->can('thing'), 'Standard->thing() exists' ); |
39 | ok( ! Standard->can('set_thing'), 'Standard->set_thing() does not exist' ); |
40 | ok( Standard->can('_private'), 'Standard->_private() exists' ); |
41 | ok( ! Standard->can('_set_private'), 'Standard->_set_private() does not exist' ); |
42 | |
b95d9f9b |
43 | ok( SAA->can('thing'), 'SAA->thing() exists' ); |
44 | ok( SAA->can('set_thing'), 'SAA->set_thing() exists' ); |
45 | ok( SAA->can('_private'), 'SAA->_private() exists' ); |
46 | ok( SAA->can('_set_private'), 'SAA->_set_private() exists' ); |
47 | |
48 | ok( SAA2->can('thing'), 'SAA2->thing() exists' ); |
49 | ok( SAA2->can('set_thing'), 'SAA2->set_thing() exists' ); |
50 | ok( SAA2->can('_private'), 'SAA2->_private() exists' ); |
51 | ok( SAA2->can('_set_private'), 'SAA2->_set_private() exists' ); |