Add Class::Inspector recommends, make resultsetmanager test skip if not installed
[dbsrgits/DBIx-Class.git] / t / 40resultsetmanager.t
index dfac9b6..97f6fc7 100644 (file)
@@ -7,7 +7,12 @@ use Test::More;
 use lib qw(t/lib);
 use DBICTest::Extra;
 
-plan tests => 4;
+BEGIN {
+    eval "use Class::Inspector";
+    plan $@
+        ? ( skip_all => 'needs Class:Inspector for testing' )
+        : ( tests => 4 );
+}
 
 my $schema = DBICTest::Extra->compose_connection('DB', 'foo');
 my $rs = $schema->resultset('Foo');
@@ -15,4 +20,4 @@ my $rs = $schema->resultset('Foo');
 ok( !DB::Foo->can('bar'), 'Foo class does not have bar method' );
 ok( $rs->can('bar'), 'Foo resultset class has bar method' );
 isa_ok( $rs, 'DBICTest::Extra::Foo::_resultset', 'Foo resultset class is correct' );
-is( $rs->bar, 'good', 'bar method works' );
\ No newline at end of file
+is( $rs->bar, 'good', 'bar method works' );