Commit | Line | Data |
b9cc2f76 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin '$Bin'; |
5 | use lib "$Bin/lib"; |
6 | |
7 | use Test::More; |
8 | use Test::Exception; |
9 | use Catalyst::Model::DBIC::Schema; |
10 | use ASchemaClass; |
11 | |
12 | plan tests => 4; |
13 | |
14 | ok((my $m = instance(a_schema_option => 'mtfnpy')), 'instance'); |
15 | |
16 | is $m->schema->a_schema_option, 'mtfnpy', 'option was passed from config'; |
17 | |
18 | lives_ok { $m->a_schema_option('pass the crack pipe') } 'delegate called'; |
19 | |
20 | is $m->schema->a_schema_option, 'pass the crack pipe', 'delegation works'; |
21 | |
22 | sub instance { |
23 | Catalyst::Model::DBIC::Schema->new({ |
24 | schema_class => 'ASchemaClass', |
25 | connect_info => ['dbi:SQLite:foo.db', '', ''], |
26 | @_, |
27 | }) |
28 | } |