Skip to content

Commit

Permalink
Item12888: Fix ConfigureSave tests
Browse files Browse the repository at this point in the history
Add a field to test undefok.  Don't depend upon TempfileDir.
  • Loading branch information
gac410 committed Jan 16, 2015
1 parent 4ffeb2f commit 43ffd46
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Expand Up @@ -86,6 +86,9 @@ $Foswiki::cfg{UnitTestContrib}{Configure}{EXPERT} = 'EXPERT';
# **PATH CHECK='undefok'**
# Default: empty
# $Foswiki::cfg{UnitTestContrib}{Configure}{empty} = 'empty';
# **STRING CHECK='undefok'**
# Default: value
$Foswiki::cfg{UnitTestContrib}{Configure}{undefok} = 'value';
# **STRING CHECK="undefok"**
# Should contain other items
$Foswiki::cfg{UnitTestContrib}{Configure}{DEP_STRING} = 'xxx$Foswiki::cfg{UnitTestContrib}{Configure}{H}xxx';
Expand Down
10 changes: 8 additions & 2 deletions UnitTestContrib/test/unit/ConfigureSaveTests.pm
Expand Up @@ -17,6 +17,7 @@ use Foswiki::Configure::Reporter;

# TODO: this needs to test that backups are correctly made
sub test_changecfg {

my $this = shift;
my $params = {
set => {
Expand All @@ -37,7 +38,7 @@ sub test_changecfg {
'{UnitTestContrib}{Configure}{REGEX}' => '(black|white)+',

# Undeffable
'{TempfileDir}' => '',
'{UnitTestContrib}{Configure}{undefok}' => undef,
}
};

Expand Down Expand Up @@ -83,7 +84,12 @@ sub test_changecfg {
level => 'notes',
text =>
q<| {UnitTestContrib}{Configure}{REGEX} | (^regex$) | '(black&#124;white)+' |>,
}
},
{
level => 'notes',
text =>
'| {UnitTestContrib}{Configure}{undefok} | \'value\' | undef |',
},
];
my $ms = $reporter->messages();

Expand Down
1 change: 1 addition & 0 deletions UnitTestContrib/test/unit/ConfigureTestCase.pm
Expand Up @@ -55,6 +55,7 @@ $Foswiki::cfg{UnitTestContrib}{Configure}{URL} = 'http://google.com';
$Foswiki::cfg{UnitTestContrib}{Configure}{H} = 'hidden';
$Foswiki::cfg{UnitTestContrib}{Configure}{EXPERT} = 'iot';
$Foswiki::cfg{UnitTestContrib}{Configure}{empty} = 'full';
$Foswiki::cfg{UnitTestContrib}{Configure}{undefok} = 'value';
$Foswiki::cfg{UnitTestContrib}{Configure}{DEP_STRING} = 'xxx$Foswiki::cfg{UnitTestContrib}{Configure}{H}xxx';
$Foswiki::cfg{UnitTestContrib}{Configure}{DEP_PERL} = {
'string' => 'real$Foswiki::cfg{UnitTestContrib}{Configure}{URL}/man'
Expand Down

0 comments on commit 43ffd46

Please sign in to comment.