Change tests to use the automatic backup of Settings in END blocks.

This commit is contained in:
Colin Kuskie 2009-03-30 20:41:02 +00:00
parent 6f3aae261b
commit 4e78593395
23 changed files with 13 additions and 93 deletions

View file

@ -37,11 +37,10 @@ BEGIN {
}
# See if we have an SMTP server to use
my ( $smtpd, %oldSettings );
my ( $smtpd );
my $SMTP_HOST = 'localhost';
my $SMTP_PORT = '54921';
if ($hasServer) {
$oldSettings{ smtpServer } = $session->setting->get('smtpServer');
$session->setting->set( 'smtpServer', $SMTP_HOST . ':' . $SMTP_PORT );
}
@ -174,9 +173,6 @@ SKIP: {
#----------------------------------------------------------------------------
# Cleanup
END {
for my $name ( keys %oldSettings ) {
$session->setting->set( $name, $oldSettings{ $name } );
}
}
#----------------------------------------------------------------------------