Modify tests to use the automatic storage cleanup provided by WebGUI::Test.
Several tests previously leaked storage locations.
This commit is contained in:
parent
decde00451
commit
1a9da53abf
11 changed files with 18 additions and 11 deletions
|
|
@ -126,6 +126,7 @@ sub setupTest {
|
|||
foreach my $testSet (@testSets) {
|
||||
|
||||
my $storage = WebGUI::Storage->create($session);
|
||||
WebGUI::Test->storagesToDelete($storage);
|
||||
my $filename = join '.', 'fileName', $testNum;
|
||||
$testSet->{filename} = $filename;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ my $spectreConf = WebGUI::Test->root . '/etc/spectre.conf';
|
|||
my $goodFile = 'The contents of this file are accessible';
|
||||
my $twoLines = "This file contains two lines of text\nThis is the second line";
|
||||
my $storage = WebGUI::Storage->createTemp($session);
|
||||
WebGUI::Test->storagesToDelete($storage);
|
||||
$storage->addFileFromScalar('goodFile', $goodFile);
|
||||
$storage->addFileFromScalar('twoLines', $twoLines);
|
||||
$storage->addFileFromScalar('unreadableFile', 'The contents of this file are not readable');
|
||||
|
|
@ -112,5 +113,4 @@ SKIP: {
|
|||
}
|
||||
|
||||
END {
|
||||
$storage->delete;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ $square->setBackgroundColor('#0000FF');
|
|||
|
||||
##Create a storage location
|
||||
my $storage = WebGUI::Storage->create($session);
|
||||
WebGUI::Test->storagesToDelete($storage);
|
||||
|
||||
##Save the image to the location
|
||||
$square->saveToStorageLocation($storage, 'square.png');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue