From: Florian Ragwitz Date: Mon, 15 Feb 2010 14:49:55 +0000 (+0000) Subject: Make sure we actually run all tests, given we're using done_testing. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=427c4089f5c034cc42d36cfeee4259e7487adb2d;p=dbsrgits%2FDBIx-Class-Historic.git Make sure we actually run all tests, given we're using done_testing. --- diff --git a/t/86sqlt.t b/t/86sqlt.t index a832325..043aa95 100644 --- a/t/86sqlt.t +++ b/t/86sqlt.t @@ -44,26 +44,32 @@ my $schema = DBICTest->init_schema (no_deploy => 1); -# replace the sqlt calback with a custom version ading an index -$schema->source('Track')->sqlt_deploy_callback(sub { - my ($self, $sqlt_table) = @_; - - is ( - $sqlt_table->schema->translator->producer_type, - join ('::', 'SQL::Translator::Producer', $schema->storage->sqlt_type), - 'Production type passed to translator object', - ); +{ + my $deploy_hook_called = 0; - if ($schema->storage->sqlt_type eq 'SQLite' ) { - $sqlt_table->add_index( name => 'track_title', fields => ['title'] ) - or die $sqlt_table->error; - } + # replace the sqlt calback with a custom version ading an index + $schema->source('Track')->sqlt_deploy_callback(sub { + my ($self, $sqlt_table) = @_; + + $deploy_hook_called = 1; - $self->default_sqlt_deploy_hook($sqlt_table); -}); + is ( + $sqlt_table->schema->translator->producer_type, + join ('::', 'SQL::Translator::Producer', $schema->storage->sqlt_type), + 'Production type passed to translator object', + ); + + if ($schema->storage->sqlt_type eq 'SQLite' ) { + $sqlt_table->add_index( name => 'track_title', fields => ['title'] ) + or die $sqlt_table->error; + } -$schema->deploy; # do not remove, this fires the is() test in the callback above + $self->default_sqlt_deploy_hook($sqlt_table); + }); + $schema->deploy; # do not remove, this fires the is() test in the callback above + ok($deploy_hook_called, 'deploy hook got called'); +} my $translator = SQL::Translator->new(