Move expensive test to xt/, add malloc-canary preventing false-negatives
[dbsrgits/DBIx-Class.git] / t / resultset_class.t
CommitLineData
c0329273 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
fac560c2 3use strict;
4use warnings;
5use Test::More;
6use Class::Inspector ();
7
fac560c2 8use DBICTest;
9
660cf1be 10is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class');
fac560c2 11ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded');
db29433c 12
fac560c2 13DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A');
db29433c 14
15ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded on SET');
fac560c2 16is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICNSTest::ResultSet::A', 'custom resultset class set');
db29433c 17ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded on GET');
fac560c2 18
19my $schema = DBICTest->init_schema;
20my $resultset = $schema->resultset('Artist')->search;
21isa_ok($resultset, 'DBICNSTest::ResultSet::A', 'resultset is custom class');
f54428ab 22
23done_testing;