From 122b59019c897df0782f4d39edc16e24aad5847e Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 3 Jul 2006 21:37:53 +0000 Subject: [PATCH] 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. --- t/Macro/SQL.t | 4 ++++ t/lib/WebGUI/Macro_Config.pm | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/t/Macro/SQL.t b/t/Macro/SQL.t index cd30aa780..06c4364a5 100644 --- a/t/Macro/SQL.t +++ b/t/Macro/SQL.t @@ -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; diff --git a/t/lib/WebGUI/Macro_Config.pm b/t/lib/WebGUI/Macro_Config.pm index 065ad0ee9..35d3d1b6d 100644 --- a/t/lib/WebGUI/Macro_Config.pm +++ b/t/lib/WebGUI/Macro_Config.pm @@ -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; }