Commit | Line | Data |
510ca912 |
1 | use strict; |
2 | use Test::More; |
3 | |
4 | #---------------------------------------------------------------------- |
5 | # Make sure subclasses can be themselves subclassed |
6 | #---------------------------------------------------------------------- |
7 | |
8 | BEGIN { |
9 | eval "use DBD::SQLite"; |
10 | plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 6); |
11 | } |
12 | |
13 | use lib 't/testlib'; |
14 | use Film; |
15 | |
16 | INIT { @Film::Threat::ISA = qw/Film/; } |
17 | |
18 | ok(Film::Threat->db_Main->ping, 'subclass db_Main()'); |
19 | is_deeply [ sort Film::Threat->columns ], [ sort Film->columns ], |
20 | 'has the same columns'; |
21 | |
22 | my $bt = Film->create_test_film; |
23 | ok my $btaste = Film::Threat->retrieve('Bad Taste'), "subclass retrieve"; |
24 | isa_ok $btaste => "Film::Threat"; |
25 | isa_ok $btaste => "Film"; |
26 | is $btaste->Title, 'Bad Taste', 'subclass get()'; |