Port remaining tests to the Opt::Dep reposiory
[dbsrgits/DBIx-Class.git] / t / storage / error.t
CommitLineData
a4b2f17b 1use Class::C3;
2use strict;
3use Test::More;
4use warnings;
5
6BEGIN {
7 eval "use DBD::SQLite";
8 plan $@
9 ? ( skip_all => 'needs DBD::SQLite for testing' )
e60dc79f 10 : ( tests => 4 );
a4b2f17b 11}
12
13use lib qw(t/lib);
14
15use_ok( 'DBICTest' );
a4b2f17b 16use_ok( 'DBICTest::Schema' );
e60dc79f 17my $schema = DBICTest->init_schema;
a4b2f17b 18
19{
20 my $warnings;
21 local $SIG{__WARN__} = sub { $warnings .= $_[0] };
e60dc79f 22 eval {
23 $schema->resultset('CD')
24 ->create({ title => 'vacation in antarctica' })
25 };
26 like $@, qr/NULL/; # as opposed to some other error
2127f7aa 27 unlike( $warnings, qr/uninitialized value/, "No warning from Storage" );
a4b2f17b 28}
29