Introduce GOVERNANCE document and empty RESOLUTIONS file.
[dbsrgits/DBIx-Class.git] / t / storage / dbi_coderef.t
1 BEGIN { do "./t/lib/ANFANG.pm" or die ( $@ || $! ) }
2
3 use strict;
4 use warnings;
5
6 BEGIN { $ENV{DBICTEST_VIA_REPLICATED} = 0 }
7
8 use Test::More;
9
10 use DBICTest;
11
12 plan tests => 1;
13
14 # Set up the "usual" sqlite for DBICTest and disconnect
15 my $normal_schema = DBICTest->init_schema( sqlite_use_file => 1 );
16 $normal_schema->storage->disconnect;
17
18 # Steal the dsn, which should be like 'dbi:SQLite:t/var/DBIxClass.db'
19 my @dsn = ($normal_schema->storage->_dbi_connect_info->[0], undef, undef, {
20   RaiseError => 1
21 });
22
23 # Make a new clone with a new connection, using a code reference
24 my $code_ref_schema = $normal_schema->connect(sub { DBI->connect(@dsn); });
25
26 # Stolen from 60core.t - this just verifies things seem to work at all
27 my @art = $code_ref_schema->resultset("Artist")->search({ }, { order_by => 'name DESC'});
28 cmp_ok(@art, '==', 3, "Three artists returned");