From 42ef2c3650c1cbd6d3529cf1946564b39f69ae9c Mon Sep 17 00:00:00 2001 From: Doug Bell Date: Thu, 29 Apr 2010 11:56:08 -0500 Subject: [PATCH] add tests for CHI --- t/Cache/CHI.t | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 t/Cache/CHI.t diff --git a/t/Cache/CHI.t b/t/Cache/CHI.t new file mode 100644 index 000000000..3ab0110d4 --- /dev/null +++ b/t/Cache/CHI.t @@ -0,0 +1,47 @@ +# vim:syntax=perl +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2009 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 +#------------------------------------------------------------------ + +# Test the CHI cache driver +# +# + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; +use Test::More; +use WebGUI::Test; # Must use this before any other WebGUI modules +use WebGUI::Session; + +#---------------------------------------------------------------------------- +# Init +my $session = WebGUI::Test->session; + + +#---------------------------------------------------------------------------- +# Tests + +plan tests => 3; # Increment this number for each test you create + +#---------------------------------------------------------------------------- +# put your tests here + +use_ok( 'WebGUI::Cache::CHI' ); + +my $cache = WebGUI::Cache::CHI->new($session, "this", "that"); +my $testValue = "a rock that has no earthly business in that field"; + +$cache->set($testValue); +is($cache->get, $testValue, "set/get works"); +$cache->delete; +is($cache->get, undef, "delete works"); + + +#vim:ft=perl