Massive cleanup of DateTime test dependencies, other interim
[dbsrgits/DBIx-Class.git] / t / cdbi / 03-subclassing.t
1 use strict;
2 use Test::More;
3
4 #----------------------------------------------------------------------
5 # Make sure subclasses can be themselves subclassed
6 #----------------------------------------------------------------------
7
8 BEGIN {
9   eval "use DBIx::Class::CDBICompat;";
10   if ($@) {
11     plan (skip_all => 'Class::Trigger and DBIx::ContextualFetch required');
12     next;
13   }
14   plan tests => 6;
15 }
16
17 use lib 't/cdbi/testlib';
18 use Film;
19
20 INIT { @Film::Threat::ISA = qw/Film/; }
21
22 ok(Film::Threat->db_Main->ping, 'subclass db_Main()');
23 is_deeply [ sort Film::Threat->columns ], [ sort Film->columns ],
24   'has the same columns';
25
26 my $bt = Film->create_test_film;
27 ok my $btaste = Film::Threat->retrieve('Bad Taste'), "subclass retrieve";
28 isa_ok $btaste => "Film::Threat";
29 isa_ok $btaste => "Film";
30 is $btaste->Title, 'Bad Taste', 'subclass get()';