9 package DBICTest::ExplodingStorage::Sth;
13 sub execute { die "Kablammo!" }
17 package DBICTest::ExplodingStorage;
20 use base 'DBIx::Class::Storage::DBI::SQLite';
24 my ($self, $sql) = @_;
25 return bless {}, "DBICTest::ExplodingStorage::Sth" unless $count++;
26 return $self->next::method($sql);
30 return 0 if $count == 1;
31 return shift->next::method(@_);
37 my $schema = DBICTest->init_schema();
39 is( ref($schema->storage), 'DBIx::Class::Storage::DBI::SQLite',
40 'Storage reblessed correctly into DBIx::Class::Storage::DBI::SQLite' );
43 my $storage = $schema->storage;
44 $storage->ensure_connected;
46 bless $storage, "DBICTest::ExplodingStorage";
47 $schema->storage($storage);
50 $schema->resultset('Artist')->create({ name => "Exploding Sheep" })
53 is($@, "", "Exploding \$sth->execute was caught");
55 is(1, $schema->resultset('Artist')->search({name => "Exploding Sheep" })->count,
56 "And the STH was retired");