[Bast-commits] r8541 - in DBIx-Class/0.08/branches/storage-interbase: lib/DBIx/Class/Storage/DBI/ODBC t

caelum at dev.catalyst.perl.org caelum at dev.catalyst.perl.org
Thu Feb 4 16:24:51 GMT 2010


Author: caelum
Date: 2010-02-04 16:24:51 +0000 (Thu, 04 Feb 2010)
New Revision: 8541

Added:
   DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm
Modified:
   DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
Log:
Firebird: fix test cleanup, add ODBC wrapper

Added: DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm	                        (rev 0)
+++ DBIx-Class/0.08/branches/storage-interbase/lib/DBIx/Class/Storage/DBI/ODBC/Firebird.pm	2010-02-04 16:24:51 UTC (rev 8541)
@@ -0,0 +1,28 @@
+package DBIx::Class::Storage::DBI::ODBC::Firebird;
+
+use strict;
+use warnings;
+use base qw/DBIx::Class::Storage::DBI::InterBase/;
+use mro 'c3';
+
+1;
+
+=head1 NAME
+
+DBIx::Class::Storage::DBI::ODBC::Firebird - Driver for using the Firebird RDBMS
+through ODBC
+
+=head1 SYNOPSIS
+
+All functionality is provided by L<DBIx::Class::Storage::DBI::Interbase>, see
+that module for details.
+
+=head1 AUTHOR
+
+See L<DBIx::Class/AUTHOR> and L<DBIx::Class/CONTRIBUTORS>.
+
+=head1 LICENSE
+
+You may distribute this code under the same terms as Perl itself.
+
+=cut

Modified: DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t
===================================================================
--- DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-04 15:08:27 UTC (rev 8540)
+++ DBIx-Class/0.08/branches/storage-interbase/t/750firebird.t	2010-02-04 16:24:51 UTC (rev 8541)
@@ -5,6 +5,7 @@
 use Test::Exception;
 use lib qw(t/lib);
 use DBICTest;
+use Scope::Guard ();
 
 # tests stolen from 749sybase_asa.t
 
@@ -34,8 +35,9 @@
 
   push @handles_to_clean, $dbh;
 
+  my $sg = Scope::Guard->new(\&cleanup);
+
   eval { $dbh->do("DROP TABLE artist") };
-
   $dbh->do(<<EOF);
   CREATE TABLE artist (
     artistid INT PRIMARY KEY,
@@ -44,7 +46,9 @@
     rank INT DEFAULT 13
   )
 EOF
+  eval { $dbh->do("DROP GENERATOR gen_artist_artistid") };
   $dbh->do('CREATE GENERATOR gen_artist_artistid');
+  eval { $dbh->do("DROP TRIGGER artist_bi") };
   $dbh->do(<<EOF);
   CREATE TRIGGER artist_bi FOR artist
   ACTIVE BEFORE INSERT POSITION 0
@@ -153,8 +157,16 @@
 done_testing;
 
 # clean up our mess
-END {
+
+sub cleanup {
   foreach my $dbh (@handles_to_clean) {
-    eval { $dbh->do("DROP TABLE $_") } for qw/artist bindtype_test/;
+    eval { $dbh->do('DROP TRIGGER artist_bi') };
+    diag $@ if $@;
+    eval { $dbh->do('DROP GENERATOR gen_artist_artistid') };
+    diag $@ if $@;
+    foreach my $table (qw/artist bindtype_test/) {
+      $dbh->do("DROP TABLE $table");
+      diag $@ if $@;
+    }
   }
 }




More information about the Bast-commits mailing list