Add strict/warnings test, adjust all offenders (wow, that was a lot)
[dbsrgits/DBIx-Class.git] / t / cdbi / has_many_loads_foreign_class.t
1 use strict;
2 use warnings;
3 use Test::More;
4 use Class::Inspector ();
5
6
7 use lib 't/cdbi/testlib';
8 use Director;
9
10 # Test that has_many() will load the foreign class.
11 ok !Class::Inspector->loaded( 'Film' );
12 ok eval { Director->has_many( films => 'Film' ); 1; } || diag $@;
13
14 my $shan_hua = Director->create({
15     Name    => "Shan Hua",
16 });
17
18 my $inframan = Film->create({
19     Title       => "Inframan",
20     Director    => "Shan Hua",
21 });
22 my $guillotine2 = Film->create({
23     Title       => "Flying Guillotine 2",
24     Director    => "Shan Hua",
25 });
26 my $guillotine = Film->create({
27     Title       => "Master of the Flying Guillotine",
28     Director    => "Yu Wang",
29 });
30
31 is_deeply [sort $shan_hua->films], [sort $inframan, $guillotine2];
32
33 done_testing;