Lose another dependency: Class::Inspector
[dbsrgits/DBIx-Class.git] / t / cdbi / has_many_loads_foreign_class.t
index bba66e8..be5553d 100644 (file)
@@ -1,15 +1,18 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+use DBIx::Class::Optional::Dependencies -skip_all_without => 'cdbicompat';
+
 use strict;
 use warnings;
-use Test::More;
-use Class::Inspector ();
 
+use Test::More;
 
 use lib 't/cdbi/testlib';
+use DBICTest::Util 'class_seems_loaded';
 use Director;
 
-# Test that has_many() will load the foreign class.
-ok !Class::Inspector->loaded( 'Film' );
-ok eval { Director->has_many( films => 'Film' ); 1; } || diag $@;
+# Test that has_many() will load the foreign class
+ok ! class_seems_loaded('Film'), 'Start non-loaded';
+ok eval { Director->has_many( films => 'Film' ); 1; } or diag $@;
 
 my $shan_hua = Director->create({
     Name    => "Shan Hua",