Skip to content

Commit

Permalink
fix upgrade test
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Sep 23, 2010
1 parent a3d4f0f commit 7a5f110
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions t/Upgrade.t
Expand Up @@ -11,6 +11,7 @@ use Test::MockObject;
use Test::MockObject::Extends;
use File::Temp;
use File::Path qw(make_path);
use File::Basename qw(basename);

use WebGUI::Paths;
use WebGUI::Upgrade;
Expand Down Expand Up @@ -70,12 +71,17 @@ capture {
ok $res, 'upgradeSites runs';
};

$upgrade->called_pos_ok(1, 'getCurrentVersion');
$upgrade->called_pos_ok(2, 'getCodeVersion');
$upgrade->called_ok('getCurrentVersion', '... and checked current version');
$upgrade->called_ok('getCodeVersion', '... and checked code version');
SKIP: {
$upgrade->called_pos_ok(4, 'runUpgradeFile') || skip 'upgrade not run', 1;
my $upgradeFile = $upgrade->call_args_pos(4, 4);
ok $upgradeFile =~ /\b00_simple\.pl$/, 'correct upgrade file run';
$upgrade->called_ok('runUpgradeFile', '... and checked code version')
or skip 'upgrade file not run', 1;
while ( my ($name, $args) = $upgrade->next_call ) {
if ($name eq 'runUpgradeFile') {
my $upgradeFile = $args->[3] && basename($args->[3]);
is $upgradeFile, '00_simple.pl', '... correct upgrade file';
}
}
}

$upgrade->clear;
Expand Down

0 comments on commit 7a5f110

Please sign in to comment.