From 4fff8c5697669be225c1bf76bbc117ad3b19a980 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 4 Jul 2006 22:00:27 +0000 Subject: [PATCH] simple test for Slash_gatewayUrl macro --- t/Macro/Slash_gatewayUrl.t | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 t/Macro/Slash_gatewayUrl.t diff --git a/t/Macro/Slash_gatewayUrl.t b/t/Macro/Slash_gatewayUrl.t new file mode 100644 index 000000000..c9b8c6cac --- /dev/null +++ b/t/Macro/Slash_gatewayUrl.t @@ -0,0 +1,41 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2006 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Macro; +use WebGUI::Session; +use WebGUI::Macro_Config; +use Data::Dumper; + +use Test::More; # increment this value for each test you create + +my $session = WebGUI::Test->session; + +unless ($session->config->get('macros')->{'/'}) { + Macro_Config::insert_macro($session, '/', 'Slash_gatewayUrl'); +} + +my $macroText = '^/;'; +my $output; + +plan tests => 1; + +$output = $macroText; + +##Note, this is not a test of the gateway method. That is done over +##in t/Session/Url.t All we need to do is make sure that the macro +##fetches the same thing as the method. + +WebGUI::Macro::process($session, \$output); +is($output, $session->url->gateway, 'fetching site gateway');