More END block work.

This commit is contained in:
Colin Kuskie 2010-06-07 18:30:41 -07:00
parent 65aa327420
commit 41b7413d01
3 changed files with 9 additions and 32 deletions

View file

@ -69,9 +69,5 @@ is( $account->getUrl( 'op=account' ), $session->url->page( 'op=account' ),
'getUrl doesnt add op=account if already exists'
);
#----------------------------------------------------------------------------
# Cleanup
END {
}
#vim:ft=perl

View file

@ -33,8 +33,7 @@ my $session = WebGUI::Test->session;
#----------------------------------------------------------------------------
# Tests
my $tests = 22;
plan tests => 1 + $tests;
plan tests => 22;
#----------------------------------------------------------------------------
# put your tests here
@ -42,14 +41,9 @@ plan tests => 1 + $tests;
my $loaded = use_ok('WebGUI::Shop::Ship');
my $storage;
my $driver;
my $driver2;
my $ship;
SKIP: {
skip 'Unable to load module WebGUI::Shop::Ship', $tests unless $loaded;
#######################################################################
#
# new
@ -152,7 +146,8 @@ cmp_deeply(
'addShipper croaks without options to build a object with',
);
$driver = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', { enabled=>1, label=>q{Jake's Jailbird Airmail}, groupToUse=>7});
my $driver = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', { enabled=>1, label=>q{Jake's Jailbird Airmail}, groupToUse=>7});
WebGUI::Test->addToCleanup($driver);
isa_ok($driver, 'WebGUI::Shop::ShipDriver::FlatRate', 'added a new, configured FlatRate driver');
#######################################################################
@ -162,7 +157,8 @@ isa_ok($driver, 'WebGUI::Shop::ShipDriver::FlatRate', 'added a new, configured F
#######################################################################
my $shippers;
$driver2 = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', { enabled=>0, label=>q{Tommy's cut-rate shipping}, groupToUse=>7});
my $driver2 = $ship->addShipper('WebGUI::Shop::ShipDriver::FlatRate', { enabled=>0, label=>q{Tommy's cut-rate shipping}, groupToUse=>7});
WebGUI::Test->addToCleanup($driver2);
$shippers = $ship->getShippers();
@ -217,13 +213,4 @@ cmp_deeply(
);
$cart->delete;
}
#----------------------------------------------------------------------------
# Cleanup
END {
$driver->delete;
$driver2->delete;
is(scalar @{$ship->getShippers()}, 1, 'getShippers: deleted all test shippers');
}
#vim:ft=perl

View file

@ -41,6 +41,8 @@ my $addExceptions = getAddExceptions($session);
my $tests = 78 + 2*scalar(@{$addExceptions});
plan tests => $tests;
WebGUI::Test->addToCleanup(SQL => 'delete from tax_generic_rates');
#----------------------------------------------------------------------------
# put your tests here
@ -680,12 +682,4 @@ sub getAddExceptions {
},
];
}
#----------------------------------------------------------------------------
# Cleanup
END {
$session->db->write('delete from tax_generic_rates');
$storage->delete;
}
#vim:ft=perl