X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fcdbi%2F06-hasa.t;h=abad17023a1258182b01570b2291f860ada1fa3f;hb=786c1cdd;hp=ef49c1448533ca368fbf35f1451f9d7e4f7e81a4;hpb=d9bd51956470404b3960871d3413fa98f16961d2;p=dbsrgits%2FDBIx-Class.git diff --git a/t/cdbi/06-hasa.t b/t/cdbi/06-hasa.t index ef49c14..abad170 100644 --- a/t/cdbi/06-hasa.t +++ b/t/cdbi/06-hasa.t @@ -1,15 +1,18 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } +use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat'; + use strict; +use warnings; + use Test::More; +use Test::Exception; +use DBIx::Class::_Util 'sigwarn_silencer'; @YA::Film::ISA = 'Film'; -#local $SIG{__WARN__} = sub { }; - -INIT { - use lib 't/cdbi/testlib'; - use Film; - use Director; -} +use lib 't/cdbi/testlib'; +use Film; +use Director; Film->create_test_film; ok(my $btaste = Film->retrieve('Bad Taste'), "We have Bad Taste"); @@ -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/is not a column on related source 'Director'/; } package Foo;