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