package # Hide from pause
  JobTest::WriteFile;

use strict;
use warnings;
use Path::Class;

sub work {
	my ($manager, $jobs_rs) = @_;

    print "Looping over coalesced jobs...\n";
    while (my $job = $jobs_rs->next) {
        print "Job...\n";
        do_write_file($job->args); 
		$job->status('done');
		$job->update;
    }
}

sub do_write_file {
    my ($args) = @_;

    print $args->{contents};
    my $fh = file($args->{filename})->open('a');

    $fh->print($args->{contents});
}

1;
