Trap erroneous warnings
[dbsrgits/DBIx-Class.git] / t / 30dbicplain.t
CommitLineData
50041f3c 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Test::More;
6
cd67f809 7use lib qw(t/lib);
50041f3c 8
c55acdbc 9plan tests => 3;
50041f3c 10
c55acdbc 11my @warnings;
12
13{
14 local $SIG{__WARN__} = sub { push(@warnings, $_[0]); };
15 require DBICTest::Plain;
16}
17
18like($warnings[0], qr/compose_connection deprecated as of 0\.08000/,
19 'deprecation warning emitted ok');
20cmp_ok(@warnings, '==', 1, 'no unexpected warnings');
50041f3c 21cmp_ok(DBICTest::Plain->resultset('Test')->count, '>', 0, 'count is valid');