Skip to content

Commit

Permalink
Add more test coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanelWade committed Sep 14, 2011
1 parent e436453 commit 88d0711
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion t/taskqueue_basics.t
Expand Up @@ -8,7 +8,7 @@ use FindBin;
use lib "$FindBin::Bin/mocks";
use File::Path ();

use Test::More tests => 41;
use Test::More tests => 42;
use cPanel::TaskQueue;

my $tmpdir = './tmp';
Expand All @@ -23,6 +23,9 @@ my $queue = cPanel::TaskQueue->new( { name => 'tasks', state_dir => $statedir }
isa_ok( $queue, 'cPanel::TaskQueue', 'Correct object built.' );
is( $queue->get_name, 'tasks', 'Queue is named correctly.' );

# Internal method, just verifying it's correct.
is( $queue->_state_file, "$statedir/tasks_queue.stor", 'State file is expected.' );

# Queue a simple item
my $qid = $queue->queue_task( 'noop 1 2 3' );
ok( $qid, 'Task queued.' );
Expand Down
5 changes: 4 additions & 1 deletion t/taskqueue_scheduler.t
Expand Up @@ -13,7 +13,7 @@ use FindBin;
use lib "$FindBin::Bin/mocks";
use File::Path ();

use Test::More tests => 84;
use Test::More tests => 85;
use cPanel::TaskQueue::Scheduler;

my $tmpdir = './tmp';
Expand All @@ -33,6 +33,9 @@ my $sched = cPanel::TaskQueue::Scheduler->new(
);
isa_ok( $sched, 'cPanel::TaskQueue::Scheduler', 'Correct object built.' );

# Internal method, do not use
is( $sched->_state_file, "$statedir/tasks_sched.stor", 'State file has correct form.' );

# Check failures to schedule
eval {
$sched->schedule_task();
Expand Down

0 comments on commit 88d0711

Please sign in to comment.