From: Justin Guenther Date: Thu, 25 May 2006 23:27:00 +0000 (+0000) Subject: squashed a couple unnecessary warnings in the CDBI-compat tests X-Git-Tag: v0.07002~75^2~161 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=97ac49db983072df503bfabb6f19a21ab0dd188f;p=dbsrgits%2FDBIx-Class.git squashed a couple unnecessary warnings in the CDBI-compat tests --- diff --git a/t/cdbi-t/01-columns.t b/t/cdbi-t/01-columns.t index 7d3f0bf..658c500 100644 --- a/t/cdbi-t/01-columns.t +++ b/t/cdbi-t/01-columns.t @@ -43,8 +43,16 @@ use base 'DBIx::Class::Test::SQLite'; City->table('City'); City->columns(All => qw/Name State Population/); -City->has_a(State => 'State'); +{ + # Disable the `no such table' warning + local $SIG{__WARN__} = sub { + my $warning = shift; + warn $warning unless ($warning =~ /\Qno such table: City(1)\E/); + }; + + City->has_a(State => 'State'); +} #------------------------------------------------------------------------- package CD; diff --git a/t/cdbi-t/18-has_a.t b/t/cdbi-t/18-has_a.t index d2fe462..ca7786e 100644 --- a/t/cdbi-t/18-has_a.t +++ b/t/cdbi-t/18-has_a.t @@ -38,7 +38,7 @@ ok( ok $pj = $btaste->Director, "Bad taste now hasa() director"; isa_ok $pj => 'Director'; { - no warnings 'redefine'; + no warnings qw(redefine once); local *Ima::DBI::st::execute = sub { ::fail("Shouldn't need to query db"); }; is $pj->id, 'Peter Jackson', 'ID already stored';