Restore ability to handle underdefined root (t/prefetch/incomplete.t)
[dbsrgits/DBIx-Class.git] / t / 107obj_result_class.t
CommitLineData
91fe73bc 1package ResultClassInflator;
2
3sub new { bless {}, __PACKAGE__ }
4
51;
6
7package main;
8
9use strict;
10use warnings;
11
12use Test::More tests => 6;
13use Test::Exception;
14use lib qw(t/lib);
15use DBICTest;
16
17my $schema = DBICTest->init_schema();
18
19my $source = $schema->source('CD');
20
21lives_ok {
22 $source->result_class('ResultClassInflator');
23 is($source->result_class => 'ResultClassInflator', "result_class gives us back class");
24 is($source->get_component_class('result_class') => 'ResultClassInflator',
25 "and so does get_component_class");
26
27 } 'Result class still works with class';
28lives_ok {
29 my $obj = ResultClassInflator->new();
30 $source->result_class($obj);
31 is($source->result_class => $obj, "result_class gives us back obj");
32 is($source->get_component_class('result_class') => $obj, "and so does get_component_class");
33 } 'Result class works with object';
34
35done_testing;