add tests for CHI
This commit is contained in:
parent
95e30aba40
commit
42ef2c3650
1 changed files with 47 additions and 0 deletions
47
t/Cache/CHI.t
Normal file
47
t/Cache/CHI.t
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue