diff --git a/t/Account/Friends.t b/t/Account/Friends.t index f630ae3f3..109447641 100644 --- a/t/Account/Friends.t +++ b/t/Account/Friends.t @@ -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 diff --git a/t/Shop/Ship.t b/t/Shop/Ship.t index 4ed1ca206..7d73d55eb 100644 --- a/t/Shop/Ship.t +++ b/t/Shop/Ship.t @@ -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 diff --git a/t/Shop/TaxDriver/Generic.t b/t/Shop/TaxDriver/Generic.t index c0809aa56..c566ed138 100644 --- a/t/Shop/TaxDriver/Generic.t +++ b/t/Shop/TaxDriver/Generic.t @@ -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