File: 21misc_fatal.t

package info (click to toggle)
libdbix-class-schema-loader-perl 0.04005-1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 360 kB
  • ctags: 243
  • sloc: perl: 3,507; makefile: 44
file content (26 lines) | stat: -rw-r--r-- 664 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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'
);