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