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