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