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