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