Skip to content

Commit

Permalink
fixed outdated testing script
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdaeppen committed Apr 22, 2013
1 parent 61dc2b3 commit 6999f42
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions pod_book/t/utils_request.t
Expand Up @@ -5,6 +5,11 @@ use warnings;

use Test::More tests => 11;

use CHI;
use File::Temp qw/ tempdir /;

my $dir = tempdir( CLEANUP => 1 );

###########################
# General module tests... #
###########################
Expand All @@ -13,11 +18,12 @@ my $module = 'PodBook::Utils::Request';
use_ok( $module );

my $obj = $module->new(
'127.0.0.1',
'metacpan::EBook::MOBI',
#"=head1 Test\n\nJust some text.\n\n",
'mobi',
'Mojolicious-PodBook-Request-t',
user_id => '127.0.0.1',
item_key => 'metacpan::EBook::MOBI',
item_type => 'mobi',
access_interval_limit => 0,
chi_ref => CHI->new( driver => 'File',
root_dir => $dir )
);

isa_ok($obj, $module);
Expand All @@ -37,8 +43,8 @@ else {
}

# write to cache
$obj->{book} = 'This is ASCII, even if a real book is binary...';
$obj->cache_book(1);
my $book = 'This is ASCII, even if a real book is binary...';
$obj->cache_book( $book, 1);
if ($obj->is_cached()) {
pass('cache hit');
}
Expand Down Expand Up @@ -80,11 +86,5 @@ else {
}








# AT THE END, CLEAR ALL THE CACHE FROM TESTING!
$obj->clear_cache();

0 comments on commit 6999f42

Please sign in to comment.