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