Macro Tests: refactored all macro tests to remove a very evil hack

for inserting macros into the config.  The new method is much cleaner
and uses the Config API.
Updated the docs for the RootTitle macro, both POD and online help.
This commit is contained in:
Colin Kuskie 2006-07-25 20:54:08 +00:00
parent cc61639232
commit f1159269a0
32 changed files with 245 additions and 132 deletions

View file

@ -22,10 +22,8 @@ use Test::More; # increment this value for each test you create
my $session = WebGUI::Test->session;
unless ($session->config->get('macros')->{'URLEncode'}) {
Macro_Config::insert_macro($session, 'URLEncode', 'URLEncode');
}
my @added_macros = ();
push @added_macros, WebGUI::Macro_Config::enable_macro($session, 'URLEncode', 'URLEncode');
my $macroText = '^URLEncode("%s");';
my $output;
@ -63,3 +61,10 @@ foreach my $testSet (@testSets) {
WebGUI::Macro::process($session, \$output);
is($output, $testSet->{output}, 'testing '.$testSet->{input});
}
END {
foreach my $macro (@added_macros) {
next unless $macro;
$session->config->deleteFromHash("macros", $macro);
}
}