Cleanup shebang lines of all maint/example scripts, remove from tests entirely
[dbsrgits/DBIx-Class.git] / t / resultset_class.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Class::Inspector ();
5
6 unshift(@INC, './t/lib');
7 use lib 't/lib';
8
9 use DBICTest;
10
11 is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class');
12 ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded');
13 DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A');
14 ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded automatically');
15 is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICNSTest::ResultSet::A', 'custom resultset class set');
16
17 my $schema = DBICTest->init_schema;
18 my $resultset = $schema->resultset('Artist')->search;
19 isa_ok($resultset, 'DBICNSTest::ResultSet::A', 'resultset is custom class');
20
21 done_testing;