Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class-Historic.git] / t / 40resultsetmanager.t
CommitLineData
762a7bb2 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use Test::More;
6
7use lib qw(t/lib);
762a7bb2 8
cc6504dc 9BEGIN {
d3231653 10 eval { require Class::Inspector };
da0d740f 11 if ($@ =~ m{Can.t locate Class/Inspector.pm}) {
d3231653 12 plan skip_all => "ResultSetManager requires Class::Inspector";
da0d740f 13 } else {
14 plan tests => 4;
15 }
cc6504dc 16}
762a7bb2 17
da0d740f 18use DBICTest::Extra; # uses Class::Inspector
19
762a7bb2 20my $schema = DBICTest::Extra->compose_connection('DB', 'foo');
21my $rs = $schema->resultset('Foo');
22
23ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' );
24ok( $rs->can('bar'), 'Foo resultset class has bar method' );
25isa_ok( $rs, 'DBICTest::Extra::Foo::_resultset', 'Foo resultset class is correct' );
cc6504dc 26is( $rs->bar, 'good', 'bar method works' );