From: Peter Rabbitson Date: Wed, 2 Sep 2009 09:07:04 +0000 (+0000) Subject: Streamline pg test-schemas cleanup X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b1bb27ec700d9da2eccd5d57dc4e16065a32819;p=dbsrgits%2FDBIx-Class-Historic.git Streamline pg test-schemas cleanup --- diff --git a/t/72pg.t b/t/72pg.t index 94d063a..40ba3d3 100644 --- a/t/72pg.t +++ b/t/72pg.t @@ -77,7 +77,7 @@ $schema->source("Artist")->name("testschema.artist"); $schema->source("SequenceTest")->name("testschema.sequence_test"); { local $SIG{__WARN__} = sub {}; - _cleanup ($dbh); + _cleanup ($schema); my $artist_table_def = <resultset('SequenceTest')->create({ name => 'foo', pkid1 => 55 is($st->pkid1, 55, "Oracle Auto-PK without trigger: First primary key set manually"); sub _cleanup { - my $dbh = shift or return; + my $schema = shift or return; + local $SIG{__WARN__} = sub {}; for my $stat ( - 'DROP TABLE testschema.artist', - 'DROP TABLE testschema.casecheck', - 'DROP TABLE testschema.sequence_test', - 'DROP TABLE testschema.array_test', + 'DROP SCHEMA testschema CASCADE', + 'DROP SCHEMA anothertestschema CASCADE', + 'DROP SCHEMA yetanothertestschema CASCADE', 'DROP SEQUENCE pkid1_seq', 'DROP SEQUENCE pkid2_seq', 'DROP SEQUENCE nonpkid_seq', - 'DROP SCHEMA testschema', - 'DROP TABLE anothertestschema.artist', - 'DROP SCHEMA anothertestschema', - 'DROP TABLE yetanothertestschema.artist', - 'DROP SCHEMA yetanothertestschema', ) { - eval { $dbh->do ($stat) }; + eval { $schema->storage->_do_query ($stat) }; } } done_testing; -END { _cleanup($dbh) } +END { _cleanup($schema) }