this stuff does not work yet
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / backcompat / 0.04006 / 21misc_fatal.t
diff --git a/t/backcompat/0.04006/21misc_fatal.t b/t/backcompat/0.04006/21misc_fatal.t
new file mode 100644 (file)
index 0000000..a1ce752
--- /dev/null
@@ -0,0 +1,26 @@
+use strict;
+use Test::More;
+use lib qw(t/lib);
+use make_dbictest_db;
+
+{
+    $INC{'DBIx/Class/Storage/xyzzy.pm'} = 1;
+    package DBIx::Class::Storage::xyzzy;
+    use base qw/ DBIx::Class::Storage /;
+    sub new { bless {}, shift }
+    sub connect_info { @_ }
+
+    package DBICTest::Schema;
+    use base qw/ DBIx::Class::Schema::Loader /;
+    __PACKAGE__->loader_options( really_erase_my_files => 1 );
+    __PACKAGE__->storage_type( '::xyzzy' );
+}
+
+plan tests => 1;
+
+eval { DBICTest::Schema->connect($make_dbictest_db::dsn) };
+like(
+    $@,
+    qr/Could not load storage_type loader "DBIx::Class::Schema::Loader::xyzzy": /,
+    'Bad storage type dies correctly'
+);