Commit | Line | Data |
89271e56 |
1 | use strict; |
2 | use warnings; |
3 | use Test::More; |
4 | |
8d6b1478 |
5 | use lib 't/lib'; |
6 | use DBICTest; |
89271e56 |
7 | |
8 | my $warnings; |
9 | eval { |
10 | local $SIG{__WARN__} = sub { $warnings .= shift }; |
11 | package DBICTest::Schema; |
12 | use base qw/DBIx::Class::Schema/; |
13 | __PACKAGE__->load_classes; |
14 | }; |
15 | ok(!$@, 'Loaded all loadable classes') or diag $@; |
16 | 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'); |
17 | |
18 | my $source_a = DBICTest::Schema->source('Artist'); |
19 | isa_ok($source_a, 'DBIx::Class::ResultSource::Table'); |
20 | my $rset_a = DBICTest::Schema->resultset('Artist'); |
21 | isa_ok($rset_a, 'DBIx::Class::ResultSet'); |
22 | |
8d6b1478 |
23 | done_testing; |