POD and code fix for Storage object delete method
This commit is contained in:
parent
c6342a6225
commit
ebdcd47f8d
2 changed files with 3 additions and 6 deletions
|
|
@ -369,7 +369,7 @@ sub createTemp {
|
||||||
|
|
||||||
=head2 delete ( )
|
=head2 delete ( )
|
||||||
|
|
||||||
Deletes this storage location and its contents (if any) from the filesystem and destroy's the object.
|
Deletes this storage location and its contents (if any) from the filesystem.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|
@ -377,7 +377,7 @@ sub delete {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $path = $self->getPath;
|
my $path = $self->getPath;
|
||||||
rmtree($path) if ($path);
|
rmtree($path) if ($path);
|
||||||
undef $self;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use WebGUI::Storage;
|
||||||
|
|
||||||
use Test::More;
|
use Test::More;
|
||||||
|
|
||||||
plan tests => 9; # increment this value for each test you create
|
plan tests => 7; # increment this value for each test you create
|
||||||
|
|
||||||
my $session = WebGUI::Test->session;
|
my $session = WebGUI::Test->session;
|
||||||
|
|
||||||
|
|
@ -46,9 +46,6 @@ ok( (-e $storageDir1 and -d $storageDir1), "Storage location created and is a di
|
||||||
|
|
||||||
$storage1->delete;
|
$storage1->delete;
|
||||||
|
|
||||||
is ( $storage1, undef, 'Object undeffed');
|
|
||||||
is ( ref $storage1, 'SCALAR', 'Object undeffed');
|
|
||||||
|
|
||||||
END {
|
END {
|
||||||
ref $storage1 eq "WebGUI::Storage" and $storage1->delete;
|
ref $storage1 eq "WebGUI::Storage" and $storage1->delete;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue