Merge 'replication_dedux' into 'trunk'
[dbsrgits/DBIx-Class.git] / t / 18inserterror.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
a4b2f17b 27 ok( $warnings !~ /uninitialized value/, "No warning from Storage" );
28}
29