Changes:
[catagits/Catalyst-Plugin-Scheduler.git] / t / 05auto_run.t
index 6446007..452a5d9 100644 (file)
@@ -5,13 +5,14 @@ use warnings;
 
 use FindBin;
 use lib "$FindBin::Bin/lib";
-use Test::More;
-use Storable qw/lock_store lock_retrieve/;
-
-plan tests => 6;
+use Test::More tests => 6;
 use Catalyst::Test 'TestApp';
 
 our $STATE = "$FindBin::Bin/lib/TestApp/scheduler.state";
+our $BASE  = 'Catalyst::Plugin::Scheduler::Base';
+
+# hack the last event check to make all events execute immediately
+$BASE->_last_check_time( 0 );
 
 TestApp->schedule(
     at       => '* * * * *',
@@ -19,9 +20,6 @@ TestApp->schedule(
     auto_run => 0,
 );
 
-# hack the last event check to make all events execute immediately
-my $state = { last_check => 0 };
-lock_store $state, $STATE;
 
 # disallow localhost
 TestApp->config->{scheduler}->{hosts_allow} = '1.2.3.4';
@@ -35,9 +33,7 @@ TestApp->config->{scheduler}->{hosts_allow} = '1.2.3.4';
 }
 
 # hack the last event check to make all events execute immediately
-$state = lock_retrieve $STATE;
-$state->{last_check} = 0;
-lock_store $state, $STATE;
+$BASE->_last_check_time( 0 );
 
 # allow localhost
 TestApp->config->{scheduler}->{hosts_allow} = [ '1.2.3.4', '127.0.0.1' ];