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