X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset_class.t;h=43054a58fecfdea489aecbf1d0a4c9870e39e56f;hb=27f3e97d85a38736e91d30f2b78195be898316d9;hp=5aa7a92eec9b1ef68fd57a83b9d17d3afe91fb96;hpb=f54428abf9cc7d7e5604745335694eaf558f6820;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/t/resultset_class.t b/t/resultset_class.t index 5aa7a92..43054a5 100644 --- a/t/resultset_class.t +++ b/t/resultset_class.t @@ -1,18 +1,20 @@ +BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } + use strict; use warnings; use Test::More; use Class::Inspector (); -unshift(@INC, './t/lib'); -use lib 't/lib'; - use DBICTest; is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICTest::BaseResultSet', 'default resultset class'); ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded'); + DBICTest::Schema->source('Artist')->resultset_class('DBICNSTest::ResultSet::A'); -ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded automatically'); + +ok(!Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class not loaded on SET'); is(DBICTest::Schema->source('Artist')->resultset_class, 'DBICNSTest::ResultSet::A', 'custom resultset class set'); +ok(Class::Inspector->loaded('DBICNSTest::ResultSet::A'), 'custom resultset class loaded on GET'); my $schema = DBICTest->init_schema; my $resultset = $schema->resultset('Artist')->search;