Added corner tests for empty string and undef.
Converted tests to handle skipping if the macro can't be loaded.
This commit is contained in:
parent
818ab4a690
commit
78c33c54ff
5 changed files with 81 additions and 10 deletions
|
|
@ -13,7 +13,6 @@ use strict;
|
|||
use lib "$FindBin::Bin/../lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
use WebGUI::Macro::GroupDelete;
|
||||
use WebGUI::Session;
|
||||
use Data::Dumper;
|
||||
|
||||
|
|
@ -119,8 +118,17 @@ foreach my $testSet (@testSets) {
|
|||
$numTests += 1 + ($testSet->{empty} == 0);
|
||||
}
|
||||
|
||||
$numTests += 1; #For the use_ok
|
||||
|
||||
plan tests => $numTests;
|
||||
|
||||
my $macro = 'WebGUI::Macro::GroupDelete';
|
||||
my $loaded = use_ok($macro);
|
||||
|
||||
SKIP: {
|
||||
|
||||
skip "Unable to load $macro", $numTests-1 unless $loaded;
|
||||
|
||||
foreach my $testSet (@testSets) {
|
||||
$session->user({ userId => $testSet->{userId} });
|
||||
my $output = WebGUI::Macro::GroupDelete::process($session,
|
||||
|
|
@ -136,6 +144,8 @@ foreach my $testSet (@testSets) {
|
|||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sub setupTest {
|
||||
my ($session, $defaultNode) = @_;
|
||||
my @groups;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue