Commit | Line | Data |
f9d8e3cf |
1 | #!perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | |
6 | use FindBin; |
7 | use lib "$FindBin::Bin/lib"; |
bec4be8c |
8 | use Test::More; |
9 | use Storable qw/lock_store lock_retrieve/; |
10 | |
11 | plan tests => 3; |
f9d8e3cf |
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 |
bec4be8c |
17 | my $state = { last_check => 0 }; |
18 | lock_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 | |