Fix building on perls with no . in @INC
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / add_invalid_relationship.t
CommitLineData
dad6d9e5 1BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3use strict;
4use warnings;
5
6use Test::More;
7use Test::Exception;
8
9use DBICTest;
10
11{
12 local $TODO = "relationship checking needs fixing";
13 # try to add a bogus relationship using the wrong cols
14 throws_ok {
15 DBICTest::Schema::Artist->add_relationship(
16 tracks => 'DBICTest::Schema::Track',
17 { 'foreign.cd' => 'self.cdid' }
18 );
19 } qr/Unknown column/, 'failed when creating a rel with invalid key, ok';
20}
21
22# another bogus relationship using no join condition
23throws_ok {
24 DBICTest::Schema::Artist->add_relationship( tracks => 'DBICTest::Track' );
25} qr/join condition/, 'failed when creating a rel without join condition, ok';
26
27
28done_testing;