Commit | Line | Data |
85781ad7 |
1 | use strict; |
2 | use warnings; |
3 | use lib 't/lib'; |
4 | |
df3ea11b |
5 | use Test::More tests => 2; |
85781ad7 |
6 | use Test::Exception; |
7 | |
8 | # Force a stack trace. |
9 | use Carp; |
10 | $SIG{__DIE__} = \&Carp::confess; |
11 | |
12 | { |
13 | package CDICompatTestApp; |
14 | use Catalyst qw/ |
15 | +CDICompatTestPlugin |
16 | /; |
17 | # Calling ->config here (before we call setup). With CDI/Cat 5.70 this |
18 | # causes *CDICompatTestApp::_config to have a class data accessor created. |
19 | |
20 | # If this doesn't happen, then later when we've added CDICompatTestPlugin |
21 | # to @ISA, we fail in the overridden ->setup method when we call ->config |
22 | # again, as we get the CAF accessor from CDICompatTestPlugin, not the one |
23 | # created in this package as a side-effect of this call. :-( |
24 | __PACKAGE__->config; |
25 | } |
26 | |
54bee50f |
27 | SKIP: { |
28 | skip 'Not trying to replicate the nasty CDI hackness', 2; |
29 | lives_ok { |
30 | CDICompatTestApp->setup; |
31 | } 'Setup app with plugins which says use base qw/Class::Accessor::Fast/'; |
8a440eba |
32 | |
54bee50f |
33 | # And the plugin's setup_finished method should have been run, as accessors |
34 | # are not created in MyApp until the data is written to. |
35 | { |
36 | no warnings 'once'; |
37 | is $CDICompatTestPlugin::Data::HAS_RUN_SETUP_FINISHED, 1, 'Plugin setup_finish run'; |
38 | } |
39 | } |