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