-while ( my $data = $obj->dequeue ) {
- ok( $data, "dequeue $i" );
- cmp_ok( $data->{i}, '==', $i, "i == $i" );
+while ( my $job = $obj->dequeue ) {
+ ok( $job, "dequeue $i" );
+ ok( my ( $dispatch, $args ) = $job->dispatch, "job->dispatch $i" );
+ cmp_ok( $dispatch, 'eq', "command-$i", "dispatch $i" );
+ diag "args = ",dump( $args ) if $debug;
+ cmp_ok( $args->{i}, '==', $i, "args i == $i" );
+ ok( $job->finish, "finish $i" );