Skip to content

Commit

Permalink
END block cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Jun 14, 2010
1 parent 2c1e2b9 commit f50d3b7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
5 changes: 2 additions & 3 deletions t/Session/DateTime.t
Expand Up @@ -20,6 +20,7 @@ use WebGUI::Session;
use Test::More tests => 90; # increment this value for each test you create

installBadLocale();
WebGUI::Test->addToCleanup(sub { unlink File::Spec->catfile(WebGUI::Test->lib, qw/WebGUI i18n BadLocale.pm/); });

my $session = WebGUI::Test->session;

Expand Down Expand Up @@ -305,6 +306,4 @@ sub installBadLocale {
);
}

END {
unlink File::Spec->catfile(WebGUI::Test->lib, qw/WebGUI i18n BadLocale.pm/);
}
#vim:ft=perl
7 changes: 1 addition & 6 deletions t/Session/Icon.t
Expand Up @@ -39,6 +39,7 @@ my $session = WebGUI::Test->session;
####################################################

my $origToolbar = $session->user->profileField('toolbar');
WebGUI::Test->addToCleanup(sub { $session->user->profileField('toolbar', $origToolbar); },);
my $toolbars = $session->url->extras('toolbar/');

my $newRequest = Test::MockObject->new;
Expand Down Expand Up @@ -168,12 +169,6 @@ sub linkAndText {
return @parsedParams;
}

my $icon = $session->icon->drag();

END {
$session->user->profileField('toolbar', $origToolbar);
}

sub fetchTestSet {
return (
{
Expand Down
8 changes: 2 additions & 6 deletions t/Session/Privilege.t
Expand Up @@ -73,6 +73,7 @@ my $session = WebGUI::Test->session;
my $privilege = $session->privilege;

my ($versionTag, $userTemplate) = setup_assets($session);
WebGUI::Test->addToCleanup($versionTag);

isa_ok($privilege, 'WebGUI::Session::Privilege', 'session has correct object type');

Expand Down Expand Up @@ -144,9 +145,4 @@ sub setup_assets {
return ($versionTag, $userTemplate);
}


END {
if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') {
$versionTag->rollback;
}
}
#vim:ft=perl
4 changes: 1 addition & 3 deletions t/Session/Stow.t
Expand Up @@ -99,6 +99,4 @@ is( $session->stow->get( 'possibilities', { noclone => 1 } ), $arr,
"With noclone returns same reference"
);

END {
$session->config->set('disableCache',$disableCache);
}
#vim:ft=perl
7 changes: 1 addition & 6 deletions t/Session/Style.t
Expand Up @@ -176,6 +176,7 @@ is($macroOutput, 1, 'generateAdditionalHeadTags: process a macro');
####################################################

my ($versionTag, $templates, $article, $snippet) = setup_assets($session);
WebGUI::Test->addToCleanup($versionTag);

$style->sent(0);
is($style->sent, 0, 'process: setup sent to 0');
Expand Down Expand Up @@ -557,9 +558,3 @@ sub setup_assets {
$versionTag->commit;
return ($versionTag, $templates, $asset, $snippet);
}

END {
if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') {
$versionTag->rollback;
}
}

0 comments on commit f50d3b7

Please sign in to comment.