1use strict; 2use Test::More; 3use lib qw(t/lib); 4use 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 19plan tests => 1; 20 21eval { DBICTest::Schema->connect($make_dbictest_db::dsn) }; 22like( 23 $@, 24 qr/Could not load storage_type loader "DBIx::Class::Schema::Loader::xyzzy": /, 25 'Bad storage type dies correctly' 26); 27