6 eval "use DBIx::Class::CDBICompat;";
7 plan skip_all => 'Class::Trigger and DBIx::ContextualFetch required' if $@;
8 eval "use DBD::SQLite";
9 plan $@ ? (skip_all => 'needs DBD::SQLite for testing') : (tests => 3);
13 use lib 't/cdbi/testlib';
16 # Test that has_many() will load the foreign class.
17 ok !Class::Inspector->loaded( 'Film' );
18 ok eval { Director->has_many( films => 'Film' ); 1; } || diag $@;
20 my $shan_hua = Director->create({
24 my $inframan = Film->create({
26 Director => "Shan Hua",
28 my $guillotine2 = Film->create({
29 Title => "Flying Guillotine 2",
30 Director => "Shan Hua",
32 my $guillotine = Film->create({
33 Title => "Master of the Flying Guillotine",
34 Director => "Yu Wang",
37 is_deeply [sort $shan_hua->films], [sort $inframan, $guillotine2];