X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F05auto_run.t;fp=t%2F05auto_run.t;h=6446007c187a331c8a4a8ee3add647c5c37d7553;hb=bec4be8c6d6006d2ba484ad0c2edae93c3ca2563;hp=452a5d91bdd9805a4fed43371839943239d5bd04;hpb=76da3546132301ff28ba5b0c4a5ca808cb8321a4;p=catagits%2FCatalyst-Plugin-Scheduler.git diff --git a/t/05auto_run.t b/t/05auto_run.t index 452a5d9..6446007 100644 --- a/t/05auto_run.t +++ b/t/05auto_run.t @@ -5,14 +5,13 @@ use warnings; use FindBin; use lib "$FindBin::Bin/lib"; -use Test::More tests => 6; +use Test::More; +use Storable qw/lock_store lock_retrieve/; + +plan 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 => '* * * * *', @@ -20,6 +19,9 @@ 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'; @@ -33,7 +35,9 @@ TestApp->config->{scheduler}->{hosts_allow} = '1.2.3.4'; } # hack the last event check to make all events execute immediately -$BASE->_last_check_time( 0 ); +$state = lock_retrieve $STATE; +$state->{last_check} = 0; +lock_store $state, $STATE; # allow localhost TestApp->config->{scheduler}->{hosts_allow} = [ '1.2.3.4', '127.0.0.1' ];