Changes:
[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 tests => 3;
9 use Catalyst::Test 'PluginTestApp';
10
11 our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
12 our $BASE  = 'Catalyst::Plugin::Scheduler::Base';
13
14 # hack the last event check to make all events execute immediately
15 $BASE->_last_check_time( 0 );
16
17 # test that the plugin event executes
18 {
19     ok( my $res = request('http://localhost/'), 'request ok' );
20     is( $res->content, 'default', 'response ok' );
21     is( -e "$FindBin::Bin/lib/TestApp/plugin_test.log", 1, 'every_minute executed ok' );
22     unlink "$FindBin::Bin/lib/TestApp/plugin_test.log";
23 }
24