From: Peter Rabbitson Date: Fri, 7 May 2010 16:28:26 +0000 (+0000) Subject: Trap erroneous warnings X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f267b29dde7ae1e10ee46fb7b372a76eb90f848b;p=dbsrgits%2FDBIx-Class-Historic.git Trap erroneous warnings --- diff --git a/t/admin/02ddl.t b/t/admin/02ddl.t index 460ff30..81ea5f8 100644 --- a/t/admin/02ddl.t +++ b/t/admin/02ddl.t @@ -28,6 +28,7 @@ my @connect_info = DBICTest->_database( no_populate=>1, sqlite_use_file => 1, ); + { # create the schema # make sure we are clean @@ -42,7 +43,10 @@ my $admin = DBIx::Class::Admin->new( isa_ok ($admin, 'DBIx::Class::Admin', 'create the admin object'); lives_ok { $admin->create('MySQL'); } 'Can create MySQL sql'; lives_ok { $admin->create('SQLite'); } 'Can Create SQLite sql'; -lives_ok { $admin->deploy() } 'Can Deploy schema'; +lives_ok { + $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /no such table.+DROP TABLE/s }; + $admin->deploy() +} 'Can Deploy schema'; } { # upgrade schema