Fixed a problem with the Macro config inserter.

Added a clause to SQL.t to force it to bail if the macro hasn't
been temporarily added to the config.
This commit is contained in:
Colin Kuskie 2006-07-03 21:37:53 +00:00
parent d95fbffa39
commit 122b59019c
2 changed files with 5 additions and 1 deletions

View file

@ -79,6 +79,10 @@ my $numTests = scalar @testSets;
plan tests => $numTests;
unless ($session->config->get('macros')->{'SQL'}) {
BAIL_OUT('SQL macro not enabled');
}
foreach my $testSet (@testSets) {
my $output = sprintf $macroText, $testSet->{sql}, $testSet->{template};
my $macro = $output;

View file

@ -2,7 +2,7 @@ package Macro_Config;
sub insert_macro {
my ($session, $nickname, $macroName) = @_;
my %macros = $session->config->get('macros');
my %macros = %{ $session->config->get('macros') };
$macros{$nickname} = $macroName;
$session->config->{_config}->{'macros'} = \%macros;
}