Commit | Line | Data |
c0329273 |
1 | BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) } |
2 | |
91fe73bc |
3 | package ResultClassInflator; |
4 | |
5 | sub new { bless {}, __PACKAGE__ } |
6 | |
7 | 1; |
8 | |
9 | package main; |
10 | |
11 | use strict; |
12 | use warnings; |
13 | |
14 | use Test::More tests => 6; |
15 | use Test::Exception; |
c0329273 |
16 | |
91fe73bc |
17 | use DBICTest; |
18 | |
19 | my $schema = DBICTest->init_schema(); |
20 | |
21 | my $source = $schema->source('CD'); |
22 | |
23 | lives_ok { |
24 | $source->result_class('ResultClassInflator'); |
25 | is($source->result_class => 'ResultClassInflator', "result_class gives us back class"); |
26 | is($source->get_component_class('result_class') => 'ResultClassInflator', |
27 | "and so does get_component_class"); |
28 | |
29 | } 'Result class still works with class'; |
30 | lives_ok { |
31 | my $obj = ResultClassInflator->new(); |
32 | $source->result_class($obj); |
33 | is($source->result_class => $obj, "result_class gives us back obj"); |
34 | is($source->get_component_class('result_class') => $obj, "and so does get_component_class"); |
35 | } 'Result class works with object'; |
36 | |
37 | done_testing; |