From 4487a7a8c771b99c9f62ded131bbe359fbd666d3 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Sun, 15 Jan 2006 05:23:11 +0000 Subject: [PATCH] more tests working --- t/Session_Env.t | 44 ++++++++++++++++++++++++++++++++++++++++++++ t/Session_Id.t | 2 +- t/Session_Os.t | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 t/Session_Env.t create mode 100644 t/Session_Os.t diff --git a/t/Session_Env.t b/t/Session_Env.t new file mode 100644 index 000000000..705ab6770 --- /dev/null +++ b/t/Session_Env.t @@ -0,0 +1,44 @@ +#------------------------------------------------------------------- +# 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 +#------------------------------------------------------------------- + +# ---- BEGIN DO NOT EDIT ---- +use strict; +use lib '../lib'; +use Getopt::Long; +use WebGUI::Session; +# ---- END DO NOT EDIT ---- + + +use Test::More tests => 1; # increment this value for each test you create + +my $session = initialize(); # this line is required + +ok($session->env->get("PATH") ne "", "get()"); + +cleanup($session); # this line is required + + +# ---- DO NOT EDIT BELOW THIS LINE ----- + +sub initialize { + $|=1; # disable output buffering + my $configFile; + GetOptions( + 'configFile=s'=>\$configFile + ); + exit 1 unless ($configFile); + my $session = WebGUI::Session->open("..",$configFile); +} + +sub cleanup { + my $session = shift; + $session->close(); +} + diff --git a/t/Session_Id.t b/t/Session_Id.t index 66cc01ce3..187a9c9b8 100644 --- a/t/Session_Id.t +++ b/t/Session_Id.t @@ -1,5 +1,5 @@ #------------------------------------------------------------------- -# WebGUI is Copyright 2001-2005 Plain Black Corporation. +# 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 diff --git a/t/Session_Os.t b/t/Session_Os.t new file mode 100644 index 000000000..7ad65247f --- /dev/null +++ b/t/Session_Os.t @@ -0,0 +1,45 @@ +#------------------------------------------------------------------- +# 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 +#------------------------------------------------------------------- + +# ---- BEGIN DO NOT EDIT ---- +use strict; +use lib '../lib'; +use Getopt::Long; +use WebGUI::Session; +# ---- END DO NOT EDIT ---- + + +use Test::More tests => 2; # increment this value for each test you create + +my $session = initialize(); # this line is required + +ok($session->os->get("name") ne "", "get(name)"); +ok($session->os->get("type") eq "Windowsish" || $session->os->get("type") eq "Linuxish", "get(type)"); + +cleanup($session); # this line is required + + +# ---- DO NOT EDIT BELOW THIS LINE ----- + +sub initialize { + $|=1; # disable output buffering + my $configFile; + GetOptions( + 'configFile=s'=>\$configFile + ); + exit 1 unless ($configFile); + my $session = WebGUI::Session->open("..",$configFile); +} + +sub cleanup { + my $session = shift; + $session->close(); +} +