ce0be84a0b44d0d22eb9bed475ca4338c0d433ab
[dbsrgits/DBIx-Class-Historic.git] / t / storage / cursor.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use Test::Exception;
6
7 use lib qw(t/lib);
8 use DBICTest;
9
10 my $schema = DBICTest->init_schema(cursor_class => 'DBICTest::Cursor');
11
12 lives_ok {
13   is($schema->resultset("Artist")->search(), 3, "Three artists returned");
14 } 'Custom cursor autoloaded';
15
16 # test component_class reentrancy
17 SKIP: {
18   DBIx::Class::Optional::Dependencies->skip_without( 'Class::Unload>=0.07' );
19
20   Class::Unload->unload('DBICTest::Cursor');
21
22   lives_ok {
23     is($schema->resultset("Artist")->search(), 3, "Three artists still returned");
24   } 'Custom cursor auto re-loaded';
25 }
26
27 done_testing;