Commit | Line | Data |
efe6365b |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
5 | use lib qw(t/lib); |
6 | use DBICTest; |
0b5dee17 |
7 | use DBICTest::ExplodingStorage; |
efe6365b |
8 | |
0b5dee17 |
9 | plan tests => 3; |
efe6365b |
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 | |
0b5dee17 |
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 | |
efe6365b |
33 | 1; |