Merge 'replication_dedux' into 'trunk'
[dbsrgits/DBIx-Class.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
748ab0dc 18BEGIN {
19 local $SIG{__WARN__} = sub {};
20 require DBIx::Class::ResultSetManager;
21}
22
b1fb2c94 23use DBICTest::ResultSetManager; # uses Class::Inspector
da0d740f 24
11357d09 25my $schema = DBICTest::ResultSetManager->compose_namespace('DB');
762a7bb2 26my $rs = $schema->resultset('Foo');
27
28ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' );
29ok( $rs->can('bar'), 'Foo resultset class has bar method' );
b1fb2c94 30isa_ok( $rs, 'DBICTest::ResultSetManager::Foo::_resultset', 'Foo resultset class is correct' );
cc6504dc 31is( $rs->bar, 'good', 'bar method works' );