Commit | Line | Data |
fac560c2 |
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'; |
fac560c2 |
8 | |
9 | use DBICTest; |
10 | |
660cf1be |
11 | is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class'); |
fac560c2 |
12 | ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded'); |
db29433c |
13 | |
fac560c2 |
14 | DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A'); |
db29433c |
15 | |
16 | ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded on SET'); |
fac560c2 |
17 | is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICNSTest::ResultSet::A', 'custom resultset class set'); |
db29433c |
18 | ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded on GET'); |
fac560c2 |
19 | |
20 | my $schema = DBICTest->init_schema; |
21 | my $resultset = $schema->resultset('Artist')->search; |
22 | isa_ok($resultset, 'DBICNSTest::ResultSet::A', 'resultset is custom class'); |
f54428ab |
23 | |
24 | done_testing; |