Some cosmetic fixes in ANFANG
[dbsrgits/DBIx-Class.git] / t / storage / cursor.t
index fb5f0cc..96f917e 100644 (file)
@@ -1,10 +1,12 @@
+BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
+
 use strict;
 use warnings;
 
 use Test::More;
 use Test::Exception;
 
-use lib qw(t/lib);
+use DBIx::Class::Optional::Dependencies;
 use DBICTest;
 
 my $schema = DBICTest->init_schema(cursor_class => 'DBICTest::Cursor');
@@ -13,4 +15,15 @@ lives_ok {
   is($schema->resultset("Artist")->search(), 3, "Three artists returned");
 } 'Custom cursor autoloaded';
 
+# test component_class reentrancy
+SKIP: {
+  DBIx::Class::Optional::Dependencies->skip_without( 'Class::Unload>=0.07' );
+
+  Class::Unload->unload('DBICTest::Cursor');
+
+  lives_ok {
+    is($schema->resultset("Artist")->search(), 3, "Three artists still returned");
+  } 'Custom cursor auto re-loaded';
+}
+
 done_testing;