Commit | Line | Data |
f9d8e3cf |
1 | package Catalyst::Plugin::PluginTest; |
2 | |
3 | use strict; |
4 | use warnings; |
5cc5ef46 |
5 | |
6 | use MRO::Compat; |
7 | Class::C3::initialize(); |
f9d8e3cf |
8 | |
9 | sub setup { |
10 | my $c = shift; |
5cc5ef46 |
11 | $c->maybe::next::method(@_); |
f9d8e3cf |
12 | |
13 | if ( $c->can('schedule') ) { |
14 | $c->schedule( |
15 | at => '* * * * *', |
16 | event => \&plugin_test, |
17 | ); |
18 | } |
19 | } |
20 | |
21 | sub plugin_test { |
22 | my $c = shift; |
23 | |
24 | # write out a file so the test knows we did something |
25 | my $fh = IO::File->new( $c->path_to( 'plugin_test.log' ), 'w' ) |
26 | or die "Unable to write log file: $!"; |
27 | close $fh; |
28 | } |
29 | |
30 | 1; |
31 | |