allow arbitrary subs to be added to test cleanup

This commit is contained in:
Graham Knop 2010-04-10 14:08:26 -05:00
parent 15939961bb
commit eb97a8d50e
2 changed files with 6 additions and 5 deletions

View file

@ -174,6 +174,7 @@ SKIP: {
skip("No InnoDB tables in this MySQL. Skipping all transaction related tests.",7) if (lc $mysqlVariables{have_innodb} ne 'yes');
$session->db->dbh->do('DROP TABLE IF EXISTS testTable');
$session->db->dbh->do('CREATE TABLE testTable (myIndex int(8) NOT NULL default 0, message CHAR(64), PRIMARY KEY(myIndex)) TYPE=InnoDB');
addToCleanup( sub { $session->db->dbh->do('DROP TABLE testTable') });
my $dbh2 = WebGUI::SQL->connect($session,$session->config->get("dsn"), $session->config->get("dbuser"), $session->config->get("dbpass"));
my ($sth, $sth2, $rc);
@ -298,6 +299,3 @@ cmp_deeply(
'Check table structure',
);
END {
$session->db->dbh->do('DROP TABLE IF EXISTS testTable');
}