From: Arthur Axel 'fREW' Schmidt Date: Sat, 20 Mar 2010 19:51:06 +0000 (-0500) Subject: more tests for ExplicitVersions X-Git-Tag: v0.001000_01~75 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ddfea806368b50b85457bc3107ee7be28bda1c2c;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git more tests for ExplicitVersions --- diff --git a/t/version_handlers/explict_versions.t b/t/version_handlers/explict_versions.t index 0d28f3b..c6d0d98 100644 --- a/t/version_handlers/explict_versions.t +++ b/t/version_handlers/explict_versions.t @@ -12,6 +12,25 @@ my $versions = [map "$_.0", 0..100]; { my $vh = ExplicitVersions->new({ ordered_versions => $versions, + schema_version => '2.0', + database_version => '1.0', + }); + + ok $vh, 'VersionHandler gets instantiated'; + + ok( + eq_array($vh->next_version_set, [qw( 1.0 2.0 )]), + 'first version pair works' + ); + ok( + !$vh->next_version_set, + 'next version set returns undef when we are done' + ); +} + +{ + my $vh = ExplicitVersions->new({ + ordered_versions => $versions, to_version => '1.0', schema_version => '1.0', database_version => '1.0', @@ -57,6 +76,15 @@ my $versions = [map "$_.0", 0..100]; dies_ok { my $vh = ExplicitVersions->new({ ordered_versions => $versions, + schema_version => '1.0', + database_version => '1.1', + }); + $vh->next_vesion_set +} 'dies if database version not found in ordered_versions'; + +dies_ok { + my $vh = ExplicitVersions->new({ + ordered_versions => $versions, to_version => '0.0', schema_version => '1.0', database_version => '1.0',