Scheduler, more tests, almost feature-complete, todo: YAML
[catagits/Catalyst-Plugin-Scheduler.git] / t / lib / Catalyst / Plugin / PluginTest.pm
1 package Catalyst::Plugin::PluginTest;
2
3 use strict;
4 use warnings;
5 use NEXT;
6
7 sub setup {
8     my $c = shift;
9     $c->NEXT::setup(@_);
10     
11     if ( $c->can('schedule') ) {
12         $c->schedule(
13             at    => '* * * * *',
14             event => \&plugin_test,
15         );
16     }
17 }
18
19 sub plugin_test {
20     my $c = shift;
21     
22     # write out a file so the test knows we did something
23     my $fh = IO::File->new( $c->path_to( 'plugin_test.log' ), 'w' )
24         or die "Unable to write log file: $!";
25     close $fh;
26 }
27
28 1;
29