fix server disconnect checking for select outside of transaction
[dbsrgits/DBIx-Class.git] / t / 92storage.t
CommitLineData
efe6365b 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
0b5dee17 7use DBICTest::ExplodingStorage;
efe6365b 8
0b5dee17 9plan tests => 3;
efe6365b 10
11my $schema = DBICTest->init_schema();
12
13is( ref($schema->storage), 'DBIx::Class::Storage::DBI::SQLite',
14 'Storage reblessed correctly into DBIx::Class::Storage::DBI::SQLite' );
15
0b5dee17 16
17my $storage = $schema->storage;
18$storage->ensure_connected;
19
20bless $storage, "DBICTest::ExplodingStorage";
21$schema->storage($storage);
22
23eval {
24 $schema->resultset('Artist')->create({ name => "Exploding Sheep" })
25};
26
27is($@, "", "Exploding \$sth->execute was caught");
28
29is(1, $schema->resultset('Artist')->search({name => "Exploding Sheep" })->count,
30 "And the STH was retired");
31
32
efe6365b 331;