diff --git a/lib/Bio/AutomatedAnnotation.pm b/lib/Bio/AutomatedAnnotation.pm index 0b7f59b..2433cb5 100644 --- a/lib/Bio/AutomatedAnnotation.pm +++ b/lib/Bio/AutomatedAnnotation.pm @@ -22,6 +22,7 @@ Automated annotation of assemblies. use Moose; use File::Basename; use Cwd; +use File::Temp; use Bio::AutomatedAnnotation::Prokka; has 'sample_name' => ( is => 'ro', isa => 'Str', required => 1 ); @@ -36,7 +37,7 @@ has 'accession_number' => ( is => 'ro', isa => 'Maybe[Str]' ); has '_annotation_pipeline_class' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__annotation_pipeline_class' ); -has '_temp_directory_obj' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__temp_directory_obj' ); +has '_temp_directory_obj' => ( is => 'ro', isa => 'File::Temp::Dir', lazy => 1, builder => '_build__temp_directory_obj' ); has '_temp_directory_name' => ( is => 'ro', isa => 'Str', lazy => 1, builder => '_build__temp_directory_name' ); sub _build__temp_directory_obj { diff --git a/t/Bio/AutomatedAnnotation.t b/t/Bio/AutomatedAnnotation.t index ee61385..86fa22a 100644 --- a/t/Bio/AutomatedAnnotation.t +++ b/t/Bio/AutomatedAnnotation.t @@ -30,6 +30,7 @@ ok( $obj = Bio::AutomatedAnnotation->new( ), 'initialise obj an accession number'); is($obj->_contig_uniq_id,'Accession456', 'Accession should be used if its provided' ); +ok($obj->_temp_directory_name,'Get a temp directory'); done_testing(); \ No newline at end of file