Add Class::Inspector recommends, make resultsetmanager test skip if not installed
[dbsrgits/DBIx-Class.git] / t / 40resultsetmanager.t
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5 use Test::More;
6
7 use lib qw(t/lib);
8 use DBICTest::Extra;
9
10 BEGIN {
11     eval "use Class::Inspector";
12     plan $@
13         ? ( skip_all => 'needs Class:Inspector for testing' )
14         : ( tests => 4 );
15 }
16
17 my $schema = DBICTest::Extra->compose_connection('DB', 'foo');
18 my $rs = $schema->resultset('Foo');
19
20 ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' );
21 ok( $rs->can('bar'), 'Foo resultset class has bar method' );
22 isa_ok( $rs, 'DBICTest::Extra::Foo::_resultset', 'Foo resultset class is correct' );
23 is( $rs->bar, 'good', 'bar method works' );