Revert Scheduler plugin back to 0.07 release state
[catagits/Catalyst-Plugin-Scheduler.git] / t / 07plugin.t
CommitLineData
f9d8e3cf 1#!perl
2
3use strict;
4use warnings;
5
6use FindBin;
7use lib "$FindBin::Bin/lib";
bec4be8c 8use Test::More;
9use Storable qw/lock_store lock_retrieve/;
10
11plan tests => 3;
f9d8e3cf 12use Catalyst::Test 'PluginTestApp';
13
14our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
15
16# hack the last event check to make all events execute immediately
bec4be8c 17my $state = { last_check => 0 };
18lock_store $state, $STATE;
f9d8e3cf 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