add self to credits
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 21misc_fatal.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use lib qw(t/lib);
5 use make_dbictest_db;
6
7 {
8     $INC{'DBIx/Class/Storage/xyzzy.pm'} = 1;
9     package DBIx::Class::Storage::xyzzy;
10     use base qw/ DBIx::Class::Storage /;
11     sub new { bless {}, shift }
12     sub connect_info { @_ }
13
14     package DBICTest::Schema;
15     use base qw/ DBIx::Class::Schema::Loader /;
16     __PACKAGE__->loader_options( really_erase_my_files => 1 );
17     __PACKAGE__->storage_type( '::xyzzy' );
18 }
19
20 plan tests => 1;
21
22 eval { DBICTest::Schema->connect($make_dbictest_db::dsn) };
23 like(
24     $@,
25     qr/Could not load loader_class "DBIx::Class::Schema::Loader::xyzzy": /,
26     'Bad storage type dies correctly'
27 );