From: Arthur Axel 'fREW' Schmidt Date: Sat, 20 Mar 2010 22:27:10 +0000 (-0500) Subject: croak instead of carp on double install X-Git-Tag: v0.001000_01~65 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-DeploymentHandler.git;a=commitdiff_plain;h=84afdcb37642d456f42de873944347b45555066b croak instead of carp on double install --- diff --git a/lib/DBIx/Class/DeploymentHandler.pm b/lib/DBIx/Class/DeploymentHandler.pm index 64c8d49..5deb9c6 100644 --- a/lib/DBIx/Class/DeploymentHandler.pm +++ b/lib/DBIx/Class/DeploymentHandler.pm @@ -62,7 +62,7 @@ has sqltargs => ( # configuration ); method install { - carp 'Install not possible as versions table already exists in database' + croak 'Install not possible as versions table already exists in database' if $self->version_storage_is_installed; my $ddl = $self->_deploy; diff --git a/t/02-instantiation.t b/t/02-instantiation.t index 82acd10..9699644 100644 --- a/t/02-instantiation.t +++ b/t/02-instantiation.t @@ -22,7 +22,7 @@ VERSION1: { upgrade_directory => $sql_dir, schema => $s, databases => 'SQLite', - sqltargs => { add_drop_table => 0 }, + sqltargs => { add_drop_table => 0 }, }); ok($handler, 'DBIx::Class::DeploymentHandler w/1.0 instantiates correctly'); @@ -37,6 +37,9 @@ VERSION1: { }) } 'schema not deployed'; $handler->install; + dies_ok { + $handler->install; + } 'cannot install twice'; lives_ok { $s->resultset('Foo')->create({ bar => 'frew',