Skip error/warn frames within CAG - saner callsite error messages this way
[dbsrgits/DBIx-Class.git] / t / 102load_classes.t
CommitLineData
89271e56 1use strict;
2use warnings;
3use Test::More;
4
5unshift(@INC, './t/lib');
6
7plan tests => 4;
8
9my $warnings;
10eval {
11 local $SIG{__WARN__} = sub { $warnings .= shift };
12 package DBICTest::Schema;
13 use base qw/DBIx::Class::Schema/;
14 __PACKAGE__->load_classes;
15};
16ok(!$@, 'Loaded all loadable classes') or diag $@;
17like($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
19my $source_a = DBICTest::Schema->source('Artist');
20isa_ok($source_a, 'DBIx::Class::ResultSource::Table');
21my $rset_a = DBICTest::Schema->resultset('Artist');
22isa_ok($rset_a, 'DBIx::Class::ResultSet');
23