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