Commit | Line | Data |
762a7bb2 |
1 | #!/usr/bin/perl |
2 | |
3 | use strict; |
4 | use warnings; |
5 | use Test::More; |
6 | |
7 | use lib qw(t/lib); |
762a7bb2 |
8 | |
cc6504dc |
9 | BEGIN { |
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 | |
b1fb2c94 |
18 | use DBICTest::ResultSetManager; # uses Class::Inspector |
da0d740f |
19 | |
11357d09 |
20 | my $schema = DBICTest::ResultSetManager->compose_namespace('DB'); |
762a7bb2 |
21 | my $rs = $schema->resultset('Foo'); |
22 | |
23 | ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' ); |
24 | ok( $rs->can('bar'), 'Foo resultset class has bar method' ); |
b1fb2c94 |
25 | isa_ok( $rs, 'DBICTest::ResultSetManager::Foo::_resultset', 'Foo resultset class is correct' ); |
cc6504dc |
26 | is( $rs->bar, 'good', 'bar method works' ); |