Commit | Line | Data |
510ca912 |
1 | use strict; |
2 | use Test::More; |
3 | |
289ba852 |
4 | BEGIN { |
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 | |
13 | BEGIN { |
14 | eval "use DBD::SQLite"; |
15 | plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); |
16 | } |
17 | |
18 | use lib 't/testlib'; |
19 | use Film; |
20 | |
21 | INIT { @Film::Threat::ISA = qw/Film/; } |
22 | |
23 | ok(Film::Threat->db_Main->ping, 'subclass db_Main()'); |
24 | is_deeply [ sort Film::Threat->columns ], [ sort Film->columns ], |
25 | 'has the same columns'; |
26 | |
27 | my $bt = Film->create_test_film; |
28 | ok my $btaste = Film::Threat->retrieve('Bad Taste'), "subclass retrieve"; |
29 | isa_ok $btaste => "Film::Threat"; |
30 | isa_ok $btaste => "Film"; |
31 | is $btaste->Title, 'Bad Taste', 'subclass get()'; |