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

@ -45,8 +45,6 @@ plan tests => $numTests;
my $macro = 'WebGUI::Macro::L_loginBox';
my $loaded = use_ok($macro);
my $originalEncryptLogin = $session->setting->get('encryptLogin');
SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
@ -245,5 +243,4 @@ END { ##Clean-up after yourself, always
if (defined $versionTag and ref $versionTag eq 'WebGUI::VersionTag') {
$versionTag->rollback;
}
$session->setting->set("encryptLogin", $originalEncryptLogin);
}

View file

@ -25,8 +25,6 @@ $numTests += 1; #For the use_ok
plan tests => $numTests;
my $preventProxyCache = $session->setting->get('preventProxyCache');
my $macro = 'WebGUI::Macro::PageUrl';
my $loaded = use_ok($macro);
@ -34,7 +32,7 @@ SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
$session->setting->set('preventProxyCache', 0) if ($preventProxyCache);
$session->setting->set('preventProxyCache', 0);
my $homeAsset = WebGUI::Asset->getDefault($session);
@ -70,5 +68,4 @@ like($output, qr{/sub/page\?noCache=\d+:\d+;query=this$}, 'checking that the que
END {
# See note in the Slash_gateway macro test about this.
$session->setting->set("preventProxyCache", $preventProxyCache);
}

View file

@ -29,8 +29,6 @@ $numTests += 1; #For the use_ok
plan tests => $numTests;
my $preventProxyCache = $session->setting->get('preventProxyCache');
my $macro = 'WebGUI::Macro::Slash_gatewayUrl';
my $loaded = use_ok($macro);
@ -38,7 +36,7 @@ SKIP: {
skip "Unable to load $macro", $numTests-1 unless $loaded;
$session->setting->set('preventProxyCache', 0) if ($preventProxyCache);
$session->setting->set('preventProxyCache', 0);
my $output;
@ -61,9 +59,4 @@ $session->setting->set('preventProxyCache', 0);
}
END {
#
# Not sure we should be doing this. I understand we want to leave things as we found them, however if this is set, a lot of tests after this one will fail.
# Perhaps we should set it to 0 always, regardless of their setting?
#
$session->setting->set('preventProxyCache', $preventProxyCache);
}

View file

@ -43,5 +43,4 @@ is($output, q|Gooey's Consulting, LLC|, "Testing companyName with embedd
}
END {
$session->setting->set('companyName', $originalCompanyName);
}