X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F06-hasa.t;h=02933cd564c642f33d5a5fd592f7462657630de7;hb=5529838f7afff91467ef2664087999ab222da48d;hp=ef49c1448533ca368fbf35f1451f9d7e4f7e81a4;hpb=d9bd51956470404b3960871d3413fa98f16961d2;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/cdbi/06-hasa.t b/t/cdbi/06-hasa.t index ef49c14..02933cd 100644 --- a/t/cdbi/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -1,5 +1,8 @@ use strict; +use warnings; use Test::More; +use Test::Exception; +use DBIx::Class::_Util 'sigwarn_silencer'; @YA::Film::ISA = 'Film'; @@ -104,7 +107,8 @@ sub taste_bad { sub fail_with_bad_object { my ($dir, $codir) = @_; - eval { + throws_ok { + local $SIG{__WARN__} = sigwarn_silencer( qr/\Qusually should inherit from the related ResultClass ('Director')/ ); YA::Film->create( { Title => 'Tastes Bad', @@ -114,8 +118,7 @@ sub fail_with_bad_object { NumExplodingSheep => 23 } ); - }; - ok $@, $@; + } qr/isn't a Director/; } package Foo;