Fixup SQLA monkeypatch in anticipation of new SQLA version
[dbsrgits/DBIx-Class.git] / t / 102load_classes.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 unshift(@INC, './t/lib');
6
7 plan tests => 4;
8
9 my $warnings;
10 eval {
11     local $SIG{__WARN__} = sub { $warnings .= shift };
12     package DBICTest::Schema;
13     use base qw/DBIx::Class::Schema/;
14     __PACKAGE__->load_classes;
15 };
16 ok(!$@, 'Loaded all loadable classes') or diag $@;
17 like($warnings, qr/Failed to load DBICTest::Schema::NoSuchClass. Can't find source_name method. Is DBICTest::Schema::NoSuchClass really a full DBIC result class?/, 'Warned about broken result class');
18
19 my $source_a = DBICTest::Schema->source('Artist');
20 isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
21 my $rset_a   = DBICTest::Schema->resultset('Artist');
22 isa_ok($rset_a, 'DBIx::Class::ResultSet');
23