X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fstorage%2Fexception.t;h=3de6aa95f7ecca9622b7670b6c938cc4014dfc63;hb=aa072cab54f2e6af9a9db82b3cdec0ebb97717cc;hp=9ce05b4da1eb0c169d9314665417a422fe9f4e86;hpb=f66e15f39f65384d95c4a254b9aefe14f32e49e3;p=dbsrgits%2FDBIx-Class.git diff --git a/t/storage/exception.t b/t/storage/exception.t index 9ce05b4..3de6aa9 100644 --- a/t/storage/exception.t +++ b/t/storage/exception.t @@ -1,11 +1,11 @@ -#!/usr/bin/perl +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } use strict; use warnings; use Test::More; use Test::Exception; -use lib qw(t/lib); + use DBICTest; use DBICTest::Schema; @@ -21,6 +21,7 @@ use DBICTest::Schema; sub _populate_dbh { my $self = shift; + my $death = $self->_dbi_connect_info->[3]{die}; die "storage test died: $death" if $death eq 'before_populate'; @@ -32,12 +33,12 @@ use DBICTest::Schema; } for (qw/before_populate after_populate/) { - dies_ok (sub { + throws_ok (sub { my $schema = DBICTest::Schema->clone; $schema->storage_type ('Dying::Storage'); $schema->connection (DBICTest->_database, { die => $_ }); $schema->storage->ensure_connected; - }, "$_ exception found"); + }, qr/$_/, "$_ exception found"); } done_testing;