Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / t / 33exception_wrap.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 use lib qw(t/lib);
8
9 use DBICTest;
10 my $schema = DBICTest->init_schema;
11
12 throws_ok (sub {
13   $schema->txn_do (sub { die 'lol' } );
14 }, 'DBIx::Class::Exception', 'a DBIC::Exception object thrown');
15
16 throws_ok (sub {
17   $schema->txn_do (sub { die [qw/lol wut/] });
18 }, qr/ARRAY\(0x/, 'An arrayref thrown');
19
20 is_deeply (
21   $@,
22   [qw/ lol wut /],
23   'Exception-arrayref contents preserved',
24 );
25
26 done_testing;