8 'DBIx::Class::DeploymentHandler::VersionHandler::Monotonic';
11 my $vh = Monotonic->new({
13 database_version => 1,
16 ok $vh, 'VersionHandler gets instantiated';
19 eq_array($vh->next_version_set, [1,2]),
20 'first version pair works'
23 !$vh->next_version_set,
24 'next version set returns undef when we are done'
29 my $vh = Monotonic->new({
32 database_version => 1,
35 ok $vh, 'VersionHandler gets instantiated';
38 !$vh->next_version_set,
39 'next version set returns undef if we are at the version requested'
44 my $vh = Monotonic->new({
47 database_version => 1,
50 ok $vh, 'VersionHandler gets instantiated';
52 eq_array($vh->next_version_set, [1,2]),
53 'first version pair works'
56 eq_array($vh->previous_version_set, [1,2]),
57 'doing previous version works'
60 eq_array($vh->next_version_set, [1,2]),
61 'first version pair works again'
64 eq_array($vh->next_version_set, [2,3]),
65 'second version pair works'
68 eq_array($vh->next_version_set, [3,4]),
69 'third version pair works'
72 eq_array($vh->next_version_set, [4,5]),
73 'fourth version pair works'
75 ok( !$vh->next_version_set, 'no more versions after final pair' );
76 ok( !$vh->next_version_set, 'still no more versions after final pair' );
80 my $vh = Monotonic->new({
82 database_version => '1.1',
85 } 'dies if database version not an Int';
88 my $vh = Monotonic->new({
91 database_version => 1,
93 } 'cannot request a version before the current version';
96 #vim: ts=2 sw=2 expandtab