Commit | Line | Data |
7abe3af2 |
1 | use strict; |
2 | use warnings; |
3 | use lib 't/lib'; |
0906c32b |
4 | use Test::More tests => 6; |
4eaa25b5 |
5 | use LoadTest; |
7abe3af2 |
6 | |
4eaa25b5 |
7 | BEGIN { |
8 | $ENV{DBIC_TRACE} = 0; |
9 | } |
5fa55fff |
10 | |
4eaa25b5 |
11 | my $raw_foo = LoadTest->source('Raw::Foo'); |
7abe3af2 |
12 | |
4eaa25b5 |
13 | is_deeply( [ $raw_foo->columns ], [qw(id a)], |
14 | 'Columns for raw foo ok: id a' ); |
7abe3af2 |
15 | |
4eaa25b5 |
16 | my $raw_bar = LoadTest->source('Raw::Bar'); |
4d88a8d7 |
17 | |
4eaa25b5 |
18 | is_deeply( [ $raw_bar->columns ], [qw(id b)], |
19 | 'Columns for raw bar ok: id b' ); |
4d88a8d7 |
20 | |
4eaa25b5 |
21 | ok( $raw_bar->has_relationship('parent'), 'parent rel exists' ); |
4d88a8d7 |
22 | |
23 | my $parent_info = $raw_bar->relationship_info('parent'); |
24 | |
4eaa25b5 |
25 | is( $parent_info->{source}, 'Raw::Foo', 'parent rel points to raw parent' ); |
4d88a8d7 |
26 | |
4eaa25b5 |
27 | my $foo = LoadTest->source('Foo'); |
28 | my $bar = LoadTest->source('Bar'); |
e7189506 |
29 | |
4eaa25b5 |
30 | is_deeply( [ $foo->columns ], |
31 | [qw(id a)], 'Columns for mti foo are still the same: id a' ); |
e7189506 |
32 | |
33 | is_deeply( |
4eaa25b5 |
34 | [ $bar->columns ], |
35 | [qw(id a words b)], |
36 | 'Columns for mti bar now contain those of foo and the mixin: id a words b' |
e7189506 |
37 | ); |