X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F18inserterror.t;h=2efb8d59eb3d4067e66cdf31b49409670f4bf0e6;hb=fec7084ae1d5c6c19987bd8e7977e32fd0ae9584;hp=043cec53f4aa9cf5f02cf0f7b3c0ea263aec8a2f;hpb=a4b2f17b810cea88ea194fb2fd3ed322f1129c6e;p=dbsrgits%2FDBIx-Class.git diff --git a/t/18inserterror.t b/t/18inserterror.t index 043cec5..2efb8d5 100644 --- a/t/18inserterror.t +++ b/t/18inserterror.t @@ -7,19 +7,23 @@ BEGIN { eval "use DBD::SQLite"; plan $@ ? ( skip_all => 'needs DBD::SQLite for testing' ) - : ( tests => 3 ); + : ( tests => 4 ); } use lib qw(t/lib); use_ok( 'DBICTest' ); - use_ok( 'DBICTest::Schema' ); +my $schema = DBICTest->init_schema; { my $warnings; local $SIG{__WARN__} = sub { $warnings .= $_[0] }; - eval { DBICTest::CD->create({ title => 'vacation in antarctica' }) }; - ok( $warnings !~ /uninitialized value/, "No warning from Storage" ); + eval { + $schema->resultset('CD') + ->create({ title => 'vacation in antarctica' }) + }; + like $@, qr/NULL/; # as opposed to some other error + unlike( $warnings, qr/uninitialized value/, "No warning from Storage" ); }