X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fresultset_class.t;h=607c1f25468962ebb426ec9f6636b4fdc58787ba;hb=eed5492fecb339252aaad11adb22651e5bd06d7b;hp=f43a71e8ad9b0f241bf2950a34e70b5a59aa8bc0;hpb=660cf1be74795a5a5784f413741816413a724c1a;p=dbsrgits%2FDBIx-Class.git diff --git a/t/resultset_class.t b/t/resultset_class.t index f43a71e..607c1f2 100644 --- a/t/resultset_class.t +++ b/t/resultset_class.t @@ -1,5 +1,3 @@ -#!/usr/bin/perl - use strict; use warnings; use Test::More; @@ -7,16 +5,20 @@ use Class::Inspector (); unshift(@INC, './t/lib'); use lib 't/lib'; -plan tests => 5; 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; isa_ok($resultset, 'DBICNSTest::ResultSet::A', 'resultset is custom class'); + +done_testing;