5a53cd9d3504e6d31a3d7a114de63abd0ca3daea
[dbsrgits/DBIx-Class.git] / xt / extra / diagnostics / unresolvable_relationship.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 use lib qw(t/lib);
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema();
11
12 my $cd = $schema->resultset('CD')->search ({}, { columns => ['year'], rows => 1 })->single;
13
14
15 throws_ok (
16   sub { $cd->tracks },
17   qr/Unable to resolve relationship .+ column .+ not loaded from storage/,
18   'Correct exception on nonresolvable object-based condition'
19 );
20
21 done_testing;