9 use Catalyst::Model::DBIC::Schema;
11 use AnotherSchemaClass;
13 # reusing the same app for 2 models, gets a redefined warning
14 $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /redefined/ };
16 ok((my $m = instance(a_schema_option => 'mtfnpy')), 'instance');
18 is $m->schema->a_schema_option, 'mtfnpy', 'option was passed from config';
20 lives_ok { $m->a_schema_option('pass the crack pipe') } 'delegate called';
22 is $m->schema->a_schema_option, 'pass the crack pipe', 'delegation works';
24 ok(($m = instance(schema_class => 'AnotherSchemaClass')), 'instance');
26 is $m->resultset('Users')->rs_config_option, 'configured rs value',
27 'ResultSet option passed from config';
32 MyApp::Model::DB->COMPONENT('MyApp', {
33 traits => 'SchemaProxy',
34 schema_class => 'ASchemaClass',
35 connect_info => ['dbi:SQLite:foo.db', '', ''],
44 'Model::DB::Users' => {
45 rs_config_option => 'configured rs value',
51 package MyApp::Model::DB;
52 use base 'Catalyst::Model::DBIC::Schema';