Make cref registry thread-safe and a ton of tests
[p5sagit/Class-Accessor-Grouped.git] / t / clean_namespace.t
CommitLineData
e4cb6320 1use Test::More;
2use strict;
3use warnings;
4
5BEGIN {
6 plan skip_all => "Package::Stash required for this test"
7 unless eval { require Package::Stash };
8
9 require MRO::Compat if $] < 5.009_005;
10}
11
12{
13 package AccessorGroups::Clean;
14 use strict;
15 use warnings;
16 use base 'Class::Accessor::Grouped';
17
18 my $obj = bless {};
19 for (qw/simple inherited component_class/) {
20 __PACKAGE__->mk_group_accessors($_ => "${_}_a");
21 $obj->${\ "${_}_a"} ('blah');
22 }
23}
24
25is_deeply
26[ sort keys %{ { map
27 { %{Package::Stash->new($_)->get_all_symbols('CODE')} }
28 (reverse @{mro::get_linear_isa('AccessorGroups::Clean')})
29} } ],
30[ sort +(
31 (map { ( "$_", "_${_}_accessor" ) } qw/simple_a inherited_a component_class_a/ ),
32 (map { ( "get_$_", "set_$_" ) } qw/simple inherited component_class/ ),
33 qw/
34 _mk_group_accessors
35 get_super_paths
36 make_group_accessor
37 make_group_ro_accessor
38 make_group_wo_accessor
39 mk_group_accessors
40 mk_group_ro_accessors
41 mk_group_wo_accessors
1ed25f9e 42 CLONE
e4cb6320 43 /,
44)],
45'Expected list of methods in a freshly inheriting class';
46
47done_testing;