fixed sql mistakes from hierarchical query tests
[dbsrgits/DBIx-Class.git] / t / 102load_classes.t
CommitLineData
89271e56 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Test::More;
6
7unshift(@INC, './t/lib');
8
9plan tests => 4;
10
11my $warnings;
12eval {
13 local $SIG{__WARN__} = sub { $warnings .= shift };
14 package DBICTest::Schema;
15 use base qw/DBIx::Class::Schema/;
16 __PACKAGE__->load_classes;
17};
18ok(!$@, 'Loaded all loadable classes') or diag $@;
19like($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');
20
21my $source_a = DBICTest::Schema->source('Artist');
22isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
23my $rset_a = DBICTest::Schema->resultset('Artist');
24isa_ok($rset_a, 'DBIx::Class::ResultSet');
25