X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fversion_handlers%2Fexplict_versions.t;h=07ad3dd3460b1488e44ac4bd854074dbf016da94;hb=327868c9f8a2ec0dbd59e820ada861b6a1fdae1c;hp=6222c505431e5bc8b26035d95f38b6c5b824f56f;hpb=86a86493b755e469429fd7b6674d7d5c78681e4f;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/t/version_handlers/explict_versions.t b/t/version_handlers/explict_versions.t index 6222c50..07ad3dd 100644 --- a/t/version_handlers/explict_versions.t +++ b/t/version_handlers/explict_versions.t @@ -1,5 +1,8 @@ #!perl +use strict; +use warnings; + use Test::More; use Test::Exception; @@ -83,19 +86,19 @@ my $versions = [map "$_.0", 0..100]; ok $vh, 'VersionHandler gets instantiated'; ok( - eq_array($vh->previous_version_set, [qw( 4.0 5.0 )]), + eq_array($vh->previous_version_set, [qw( 5.0 4.0 )]), 'first version pair works' ); ok( - eq_array($vh->previous_version_set, [qw( 3.0 4.0 )]), + eq_array($vh->previous_version_set, [qw( 4.0 3.0 )]), 'second version pair works' ); ok( - eq_array($vh->previous_version_set, [qw( 2.0 3.0 )]), + eq_array($vh->previous_version_set, [qw( 3.0 2.0 )]), 'third version pair works' ); ok( - eq_array($vh->previous_version_set, [qw( 1.0 2.0 )]), + eq_array($vh->previous_version_set, [qw( 2.0 1.0 )]), 'fourth version pair works' ); ok( !$vh->previous_version_set, 'no more versions after final pair' ); @@ -119,7 +122,17 @@ dies_ok { database_version => '1.0', }); $vh->next_version_set; -} 'cannot request a version before the current version'; +} 'cannot request an upgrade before the current version'; + +dies_ok { + my $vh = ExplicitVersions->new({ + ordered_versions => $versions, + to_version => '2.0', + schema_version => '1.0', + database_version => '1.0', + }); + $vh->previous_version_set; +} 'cannot request a downgrade after the current version'; done_testing; #vim: ts=2 sw=2 expandtab