Revert Scheduler plugin back to 0.07 release state
[catagits/Catalyst-Plugin-Scheduler.git] / t / 07plugin.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use FindBin;
7 use lib "$FindBin::Bin/lib";
8 use Test::More;
9 use Storable qw/lock_store lock_retrieve/;
10
11 plan tests => 3;
12 use Catalyst::Test 'PluginTestApp';
13
14 our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
15
16 # hack the last event check to make all events execute immediately
17 my $state = { last_check => 0 };
18 lock_store $state, $STATE;
19
20 # test that the plugin event executes
21 {
22     ok( my $res = request('http://localhost/'), 'request ok' );
23     is( $res->content, 'default', 'response ok' );
24     is( -e "$FindBin::Bin/lib/TestApp/plugin_test.log", 1, 'every_minute executed ok' );
25     unlink "$FindBin::Bin/lib/TestApp/plugin_test.log";
26 }
27